I am setting up an app called Jenkins on the Mac which is a build tool.
There are many VERY helpful articles on this topic and they all involve modifying a plist to point to a newly created user.
They ALL say to start/stop using sudo
sudo launchctl unload -w /Library/LaunchDaemons/org.jenkins-ci.plist sudo launchctl load -w /Library/LaunchDaemons/org.jenkins-ci.plist
and they all say to create a NEW user for this purpose (how about an existing user?)
sudo dscl . create /Users/jenkins sudo dscl . create /Users/jenkins PrimaryGroupID 1 sudo dscl . create /Users/jenkins UniqueID 300 sudo dscl . create /Users/jenkins UserShell /bin/bash sudo dscl . create /Users/jenkins home /Users/Shared/Jenkins/Home/ sudo dscl . create /Users/jenkins NFSHomeDirectory /Users/Shared/Jenkins/Home/ sudo dscl . passwd /Users/jenkins
Now I am new to mac. And this tells me NOTHING about:
- how to make the app/service/daemon startup automatically when restarting the machine.
- How does this give the user jenkins the permissions needed?
- also I needed to login with one user to change the plist then back in with another user etc.
- I don't even see this newly created user in /Users/jenkins at all, although each line executed ok. I don't see /Users/jenkins.
- How will starting the machine and loggin in as admin account cause this jenkins user and the daemon to startup? I just don't get it? Do I need to add the sudo to some startup script in the admin.
I mean really this is what I think everyone thinks of when they think of having a daemon process running. Not constantly executing sudo this and sudo that.
I am not at all what will happen if I boot the machine and login with user jenkins. How do I make the jenkins server run no matter which user is actually logged into the machine?
Note: I executed everything from an admin account. Not root.
So I need some complete information on how to do this.
I mean what is the point of a daemon if I need to sudo load each time the machine starts?
Now my exact situation is I already have an admin user jenkinsadmin that I want to use to monitor the machine etc. Creating this new user as above did not give me a user with admin permissions at all. In fact executing sudo was not possible. So how do I auto start this jenkins each time the machine boots and I login with jenkinsadmin?