[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: systemd service and /etc/default/



On 17/08/14 12:48, Marco d'Itri wrote:
> On Aug 17, Marc Haber <mh+debian-devel@zugschlus.de> wrote:
>> It is not
>> always possible to come with a working default configuration or to
>> build one in postinst.
>
> If unconfigured software really cannot fail cleanly then the package can 
> install it without enabling the service.
> Or systemd can notice that there is no config file and hence not try to 
> start the daemon.

FYI: systemd:

[Unit]
ConditionPathExists=/etc/foo.conf

or sysvinit:

if ! [ -e /etc/foo.conf ]
then
    echo -n "(not starting, you need to create /etc/foo.conf)"
    return 0
fi

This seems better than the ENABLED=1 anti-pattern: start the service if
and only if it has been configured.

    S


Reply to: