Am 25.01.2018 um 09:14 schrieb Michael Biebl: > Am 24.01.2018 um 23:21 schrieb Felipe Sateler: >> On Wed, Jan 24, 2018 at 5:44 PM, Michael Biebl <[email protected]> wrote: > >>>> if ! [ -d /run/systemd/system ] || ! [ -e /lib/sytemd/system/foo.service ] >>>> ; then >>>> invoke-rc.d foo $_dh_action || exit 1 >>>> fi >>> >> >> Something like this, yes. But this seems a bit simplistic (would we >> want to check /etc, /usr/lib, /usr/local/lib and /run ?) > > Hm, not sure. Imho packages shipping a native service file should imho > either make sure to have a name which matches the one of the SysV init > script, or provide a static symlink in the package (i.e. not one that is > generated via systemctl enable). For a package which uses a generator, > i.e. generate the .service files on the fly, the package should ship a > static symlink in the package /lib/systemd/system/foo.service -> /dev/null. > > In all these cases, the simple check I suggested would be sufficient. > > Felipe, do you have a case in mind this would not cover?
Fwiw, I also considered moving the above check into invoke-rc.d itself. I.e. if invoke-rc.d detects that it is running in a dpkg context and there is a matching service file, it will do nothing. But then again, invoke-rc.d can't know if the package was compiled with compat 12 support or not, i.e. if there will be the necessary deb-systemd-invoke calls. -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature

