Summary: | sci-mathematics/gimps improved systemd unit file | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Paolo Pedroni <paolo.pedroni> |
Component: | Current packages | Assignee: | Thomas Kahle (RETIRED) <tomka> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | sci-mathematics, systemd |
Priority: | Normal | ||
Version: | 10.1 | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Improved systemd unit file for gimps |
Description
Paolo Pedroni
2014-03-07 11:49:13 UTC
Created attachment 371946 [details]
Improved systemd unit file for gimps
Comment on attachment 371946 [details]
Improved systemd unit file for gimps
--- files/gimps.service 2014-02-15 13:22:34.000000000 +0100
+++ - 2014-03-07 15:59:35.645603343 +0100
@@ -4,9 +4,14 @@
Wants=local-fs.target
[Service]
+EnvironmentFile=/etc/conf.d/gimps
User=nobody
Group=nobody
-ExecStart=/opt/gimps/mprime -w/var/lib/gimps
+PermissionsStartOnly=true
+ConditionPathIsDirectory=${GIMPS_DIR}
+ExecStartPre=-/bin/sh -c "chown %u ${GIMPS_DIR}"
+ConditionPathExist=${GIMPS_DIR}/local.txt
+ExecStart=/opt/gimps/mprime -w${GIMPS_DIR} ${GIMPS_OPTIONS}
StandardOutput=null
StandardError=journal
Included in 28.5. Thanks! I am unsure it's really an improvement: https://wiki.gentoo.org/wiki/Systemd/Ebuild_policy#Unit_file_guidelines Explains why relying on conf.d files is not a good idea. In this case, the unit file I provided was using the default directory and the tmpfiles.d file was ensuring it was created with proper permissions already. Now, people can play with that directory and we need to die when it's not present and fix permissions from unit file :/ Regarding GIMPS_OPTIONS, current conf.d file simply sets none, then, I don't think there is such need of letting people to pass random options from there (they can change ExecStart if they want to play with all the available options) Pacho, I'm sorry. I had not seen this wiki page before, and I have not run systemd on any of my systems yet. If you care to do it, please commit a better version, revert to the old version, or suggest a resolution that I can implement. This is an uncommon package and my commit is very recent. If we fix things now, then chances are that no users see this ever. I would revert to previous as I have explained for this concrete case (I have no problem on adding ways to configure things in some packages, but for this concrete case I committed the "non configurable one" on purpose to ensure we provide a unit file that will use a directory managed by systemd via tmpfiles.d Done. Thanks. + 07 Mar 2014; Thomas Kahle <tomka@gentoo.org> -files/gimps.service-r1, + gimps-28.5.ebuild: + Revert back to original systemd unit file after consulting systemd team |