Bug#941198: In support of mandatory unit files
Tobias Frost <tobi@debian.org> writes:
> Am Samstag, den 07.12.2019, 17:12 -0800 schrieb Russ Allbery:
>> A Policy should means that if there is some stronger reason (such as
>> that adding a unit file would introduce new bugs), there is nothing
>> requiring you to do so. It indicates that not having a unit file is a
>> bug, but it's just a bug, and Debian packages are not expected to be
>> bug- free. Other bugs may be more important.
> Well, I was responding to a mail that suggested to make unit files
> mandatory (which I read as then RC-buggy) and suggesting some lines
> later to drop support for the sysv-generator and in this case it is
> quite moot that policy can be ignored because I fear that once unit
> files would become mandatory that would be used as an argument to drop
> support for the generator.
Just to be clear, that's not what this bug proposes. This bug just
proposes making systemd unit files recommended.
> Sure, help fir that would be nice. Thanks for the offer. (Probably
> should have an own bug for that.) Nethertheless, this is the line that
> causes my problems and needs to be transferred:
> https://salsa.debian.org/debian/gmrender-resurrect/blob/master/debian/gmediarender.default#L8
Ah, I see, the problem is the $(hostname) part, which isn't supported by
EnvironmentFile in systemd (which is the normal way to solve this
problem).
After looking at this for a bit, my inclination if I were you would be to
write a tiny shell script that loads /etc/default/gmediarender, constructs
the command line, and then execs the daemon; install that script as
/usr/share/gmediarender/start; and then invoke that script via
start-stop-daemon in the init script and via ExecStart in the systemd unit
file. It's a little bit overkill because most of what the /etc/default
file is doing is simple, but it looks like the easiest way to handle
$(hostname).
--
Russ Allbery (rra@debian.org) <https://www.eyrie.org/~eagle/>
Reply to: