Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 665030 - dev-util/jenkins-bin: systemd service does not inherit configuration file
Summary: dev-util/jenkins-bin: systemd service does not inherit configuration file
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-01 13:30 UTC by Georg Voigtländer
Modified: 2019-01-15 22:52 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Replace options with variables from jenkins-bin.confd (jenkins-bin.service,566 bytes, text/plain)
2018-09-01 13:30 UTC, Georg Voigtländer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Voigtländer 2018-09-01 13:30:46 UTC
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
Comment 1 Stefan Cristian Brindusa 2018-12-09 17:12:28 UTC
Proposed configuration for systemd services file usage:

https://github.com/gentoo/gentoo/pull/10599
Comment 2 Stefan Cristian Brindusa 2018-12-09 18:58:31 UTC
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
Comment 3 Larry the Git Cow gentoo-dev 2018-12-11 10:33:12 UTC
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(+)
Comment 4 Hans de Graaff gentoo-dev Security 2018-12-11 10:34:41 UTC
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.
Comment 5 Stefan Cristian Brindusa 2018-12-16 18:38:31 UTC
Hey. Do I have to cover additional details on SystemD configuration?

Shall I cover also the new ebuilds & PR change them?
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-13 10:28:18 UTC
(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.
Comment 7 Hans de Graaff gentoo-dev Security 2019-01-13 10:37:05 UTC
(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.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-13 10:39:18 UTC
(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.
Comment 9 Stefan Cristian Brindusa 2019-01-15 22:52:47 UTC
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