timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-32300] prevent Jenkins startup if JENKINS_HOME is empty #7753

Open timja opened 8 years ago

timja commented 8 years ago

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
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 8 years ago

danielbeck:

Why not just prohibit creation of the JENKINS_HOME on the parent folder level?

timja commented 8 years ago

teilo:

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 )

timja commented 8 years ago

danielbeck:

Nothing prevents you from using /mnt/nfsmount/jenkins_home as JENKINS_HOME, no?

timja commented 8 years ago

oleg_nenashev:

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: