Open timja opened 8 years ago
Why not just prohibit creation of the JENKINS_HOME on the parent folder level?
you need the JENKINS_HOME directory in order to mount on it (on *nix unless you are using some automount magic) - so the directory already exists (but its empty).
If you remove the permissions to write from it - then tbh without trying I have no idea how mounting would work - but (and here is the but) mounting is very different across different servers (nfs, afs, cifs etc) and operating systems (windows, linux etc).
Ideally I would say that Jenkins should not unpack itself or create an instance file (secret.key) in normal operations but only do so when started with a special flag. (used for new installs and upgrades) - but that would likely break people that use web containers to run the software. (alla gerrit init )
Nothing prevents you from using /mnt/nfsmount/jenkins_home as JENKINS_HOME, no?
danielbeck Jenkins automatically creates folders within its JENKINS_HOME path, so it's hard to completely prevent home dir re--spinning.
> Nothing prevents you from using /mnt/nfsmount/jenkins_home as JENKINS_HOME, no?
Not an option for existing setups
My vision of TODOs:
If JENKINS_HOME is on a shared drive and there the share is not setup reliably there is a possibility that Jenkins will start up before JENKINS_HOME is mounted.
Jenkins will then startup and it will not have its file and will even generate a new instance identity (secret.key)
There should be a way to prevent Jenkins starting with this setup (possibly with an extra flag).
Originally reported by teilo, imported from: prevent Jenkins startup if JENKINS_HOME is empty