User has to choose a custom installation.
There are two choices:
- Start at boot as "daemon" (enabled by default)
- Start at boot as "jenkins" (disabled by default)
If user disables the first and enable the latter, the installer
will create a new user "jenkins" and new group "jenkins"
(if they do not exist), chown JENKINS_HOME to jenkins:jenkins
and set up launchd job to run Jenkins as "jenkins"
Also fixed some permission errors that PackageMaker complains about
when building the package.
Also PackageMaker xml file reformatted to be more readable
Sometimes users unload Jenkins using the launchctl -w option.
This permanently disables the Jenkins launchd job.
When the user re-installs Jenkins, he gets confused when
Jenkins doesn't load and run automatically and there is no
good error message from launchctl when it ignores the
Jenkins job because it is permanently disabled.
("nothing found to load")
Always forcing Jenkins to run after installation seems to be
the way of minimum confusion. The user is installing Jenkins
because he wants to run Jenkins, right?
Although there aren't any Jenkins packages deployed that use a launch daemon, soon there will be.
Let's make the preinstall capable of handling that already now.
Files under /Applications are usually owned by root and wheel, unless admin user has dragged it there. Jenkins is not an install-by-dragging kind of app.
This is consistent with Apple's guidelines for
LaunchAgents vs. LaunchDaemons. Daemons start at
boot, and are not associated with a user. Agents
on the other hand are associated with a specific
user.