Created attachment 545726 [details] Replace options with variables from jenkins-bin.confd Current jenkins-bin.service does not include any configuration options from jenkins-bin.confd
Proposed configuration for systemd services file usage: https://github.com/gentoo/gentoo/pull/10599
It seems that any other variant of JENKINS_ARGS taking double-dashes is not an option, due to the fact that "--" is not taken lightly by systemd ExecStart, nor by /usr/bin/java It cannot be escaped 'safely', unless we provide a all-in-one command under a single variable ( JENKINS_COMMAND_LINE ) and eval-ed after
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bb8646ba90649df00938a7919b985364558760e commit 6bb8646ba90649df00938a7919b985364558760e Author: Hans de Graaff <graaff@gentoo.org> AuthorDate: 2018-12-11 10:32:36 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2018-12-11 10:32:54 +0000 dev-util/jenkins-bin: use jenkins.conf also for systemd Use the options specified in /etc/conf.d/jenkins.conf also for the systemd service, rather than hardcoding specific values. Thanks to Georg Voigtländer for providing the updated service file. Bug: https://bugs.gentoo.org/665030 Signed-off-by: Hans de Graaff <graaff@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 dev-util/jenkins-bin/files/jenkins-bin.service2 | 11 ++++++ dev-util/jenkins-bin/jenkins-bin-2.150.1-r1.ebuild | 46 ++++++++++++++++++++++ dev-util/jenkins-bin/jenkins-bin-2.155-r1.ebuild | 46 ++++++++++++++++++++++ 3 files changed, 103 insertions(+)
I have added the systemd service file by Georg to the ebuilds. We can continue the discussion on the additional changes by Stefan in the github PR where review comments have been added. I'll leave this bug open for now while that discussion is ongoing.
Hey. Do I have to cover additional details on SystemD configuration? Shall I cover also the new ebuilds & PR change them?
(In reply to Larry the Git Cow from comment #3) > The bug has been referenced in the following commit(s): > > https://gitweb.gentoo.org/repo/gentoo.git/commit/ > ?id=6bb8646ba90649df00938a7919b985364558760e > > commit 6bb8646ba90649df00938a7919b985364558760e > Author: Hans de Graaff <graaff@gentoo.org> > AuthorDate: 2018-12-11 10:32:36 +0000 > Commit: Hans de Graaff <graaff@gentoo.org> > CommitDate: 2018-12-11 10:32:54 +0000 > > dev-util/jenkins-bin: use jenkins.conf also for systemd > > Use the options specified in /etc/conf.d/jenkins.conf also > for the systemd service, rather than hardcoding specific values. > > Thanks to Georg Voigtländer for providing the updated service file. > > Bug: https://bugs.gentoo.org/665030 > Signed-off-by: Hans de Graaff <graaff@gentoo.org> > Package-Manager: Portage-2.3.51, Repoman-2.3.11 > > dev-util/jenkins-bin/files/jenkins-bin.service2 | 11 ++++++ > dev-util/jenkins-bin/jenkins-bin-2.150.1-r1.ebuild | 46 > ++++++++++++++++++++++ > dev-util/jenkins-bin/jenkins-bin-2.155-r1.ebuild | 46 > ++++++++++++++++++++++ > 3 files changed, 103 insertions(+) Please revert this. Using conf.d in systemd is forbidden, and Portage should warn you about that, verbosely.
(In reply to Michał Górny from comment #6) > Please revert this. Using conf.d in systemd is forbidden, and Portage > should warn you about that, verbosely. For reference: it looks like you are referring to this policy: https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files I don't think the ebuild does what you think it does (i.e. it does not use the file in /etc/conf.d). I have seen no portage warnings. The common conf file also does match all systemd expectations and does not contain any shell code.
(In reply to Hans de Graaff from comment #7) > (In reply to Michał Górny from comment #6) > > > Please revert this. Using conf.d in systemd is forbidden, and Portage > > should warn you about that, verbosely. > > For reference: it looks like you are referring to this policy: > https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files > > I don't think the ebuild does what you think it does (i.e. it does not use > the file in /etc/conf.d). I have seen no portage warnings. The common conf > file also does match all systemd expectations and does not contain any shell > code. If it isn't conf.d, it shouldn't reside in /etc/conf.d. If it is, it shouldn't be used in systemd. No exceptions. Pro-tip: some systemd users install-mask /etc/conf.d.
I closed my PR The best approach is not to configure EnvironmentFile as configuration file to inherit a small set of special configuration, but to declare the variables that Jenkins needs in the environment itself Best option would be to set EnvironmentFile to /etc/env* and that can be generally taken from the system as a whole