Meteor requires sudo to run - macos

Previously I was able to start Meteor 0.6.6.3 by simply running mrt.
Recently, Meteor 0.7.0.1 wont run properly unless I run it as root with sudo mrt. Environmental variables like MONGO_URL requires root to set it.
Any ideas what happened? I'm using Mountain Lion on Mac OSX.

You might have run it with sudo once before. When you run it with sudo just once and a file is written the files become root files root user file so it needs more permissions to run and wont run
ordinarily.
You might have run sudo mrt once it must have updated files for a package but they're now owned by root instead of your normal user.
I'm sure theres a terminal command to get it back but using Disk Utility and running 'Repair Disk Permissions' can also fix it (i think).

Related

'Jenkins' user is not created on OS X install

When reading about Jenkins installation, many guides talk about that the installer created a user called 'Jenkins' on OS X. This user seems to be important for certain tasks.
However, installing Jenkins 2.32 using homebrew does not install this user here. Why is that - am I missing something?
Background: I want to run CI for iOS together with a Gitlab server.
Jenkins installed via Homebrew is kind of a mess - and I say this because it isn't terribly obvious in the log output where/who gets permissions.
Jenkins DOES NOT create a jenkins user on Mac OS (nor should it ever, imo).
By default, the user that was actively using brew install jenkins is the one who will get the default permissions. There should be a /.jenkins folder within that users home folder (ex: /Users/<your_user>/.jenkins)
The problem is that when brew finishes running, some files that should get symlinked to the active user don't - so you might create a job using rvm/ruby for example, and get errors that bundler can't write to the system ruby.
Try this in terminal/iTerm:
sudo chown whoami /Library/LaunchDaemons/homebrew.mxcl.jenkins.plist
also whoami should be surrounded by ticks `
I tend to just do these commands after a brew install jenkins
ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents
Symlink the Jenkins plist files to /Library/LaunchAgents
sudo cp -fv /usr/local/opt/jenkins/*.plist /Library/LaunchDaemons
Copy plist files to /Library/LaunchDaemons
sudo chownwhoami/Library/LaunchDaemons/homebrew.mxcl.jenkins.plist
Give sudo ownership of the plist file listed to the user outright
This part isn't necessary...
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
Here's something to refer to:
http://flummox-engineering.blogspot.com/2016/01/installing-jenkins-os-x-homebrew.html

Unable to set "mongod" PATH

I'm having issues trying to run mongod upon terminal start up.
OS
OSX 10.11.4
Steps so far:
Download OS X 10.7+ 64-bit
Uncompress mongodb-osx-x86_64-3.2.5.tgz
Rename mongodb-osx-x86_64-3.2.5 to mongodb
Moved /mongodb to [Desktop/development]
Add /data/db to Desktop/development/mongodb/bin
Changed permissions to /data/db using chmod 777 /data/db
Within Desktop/development/mongod/bin typing ./mongod everything is working as expected and I can access the the mongo shell. Now I would like to just be able to type mongod upon terminal startup and run both mongo and mongod
PATH for mongod
Open bash file vi ~/.bashrc
While in insert mode: export PATH=Desktop/development/mongodb/bin:$PATH I've also tried export PATH=$Home/Desktop/development/mongodb/bin:$PATH
What am I missing or doing wrong?
Thanks
EDIT
As per suggestions I've moved all the mongo files into a more appropriate locations.
Mongo location: $HOME/mongodb/bin
Mongo DB location: $HOME/mongoData
Data/db location: $HOME/mongoData/data/db
Bash command: export PATH=$HOME/mongodb/bin:$PATH
I'm thinking this is correct, but still unable to run mongod is there something missing in the bash command? Like mongo = PATH=...?
Desktop is actually $HOME/Desktop as it's in your home directory, so you need:
export PATH=$HOME/Desktop/development/mongodb/bin:$PATH
Desktop is not the place to put stuff as it's nothing much more than a convenience area that you can add to and remove from at a whim. It's also too visible as you will see the folder icons.
You should have installed all that stuff into your home directory (or /usr/local if you want it available to all users).
Also "Add /data/db to Desktop/development/mongodb/bin" doesn't look right to me as data and executables are different.
If I was adding mongodb for development then I would have installed it via Macports with:
$ sudo port install mongodb
and would be up and working in less than 2 minutes.

How can I access sudo command when bin permissions are not set for execute

Actually I'm new to mac.
I accidentally took away all permissions on bin directory for users. Now I cannot access any commands and moreover I cannot even access the root user on my mac, sudo command also not running. It says you don't have permission.
Can anybody please tell me how do I resolve this issue?
Thanks!

Sudo Won't Work after change/mistake in Path env

I'm a Mac newbie and just upgraded to Node.js 0.67. After running node, the installer says "Make sure that /usr/local/bin is in your $PATH."
And I try to run node but as expected, it doesn't run without the path change.
So not really knowing what I'm doing (yes!), after some research I do this:
export "PATH=/usr/local/bin"
And node runs. But sudo doesn't. Which I think means I screwed up the environment variables.
sudo: command not found
Then in another Terminal window (that was open when I messed this up), sudo does respond; both windows have the same path. But in that window, npm is no longer available.
Can anyone help get me back to sudo stability?
sudo on a Macintosh lives in /usr/bin.
Make sure /usr/bin is in your $PATH environment and you should be okay.
And to do that, in the context of your question above, do something like:
export "PATH=$PATH:/usr/local/bin"
The idea here being that you are appending a new search path to the already existing list in your PATH environment variable.
Here is a potentially useful tutorial you can refer to.

Is it safe to run a ruby script using sudo?

I am running redmine on Ubuntu, and I am running it using sudo.
If I try to run as my redmine user, I get permission errors on the log file.
Is this safe? Should I be concerned?
You should be careful when running any sort of web application as root. Personally, I would not recommend it.
If permissions problems on the logfile are your only problems, the better solution would be to alter the permissions of the log files/folders. Make sure the log files belong to the user account that Redmine is running as (or have group write permissions and belong to the same group). You might have to use sudo to change those permissions, but it is much safer than running a web application as root.
Any time you run a script using sudo you should be concerned since in effect you are running the script as root. Therefore, to give an extreme example, if the script executes a command similar to rm -rf / you will wipe out the entire system....it's best not to use sudo to execute scripts unless you are completely aware of what the script is doing and any potentially tainted data that is consumed by it!

Resources