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

How should the systemd setup in a postinst script look?



I am trying to get rid of the lintian messages of my apache karaf debian
package:
 https://github.com/steinarb/karaf-debian

One of the warnings still present, is:
 W: karaf: maintainer-script-calls-systemctl postinst:30

The relevant part of the script, is:
 case "$1" in
     configure)
         create_daemon_user
         change_karaf_files_ownership
         deb-systemd-helper enable karaf.service
         systemctl daemon-reload
         systemctl start karaf
         echo "Started karaf daemon"
     ;;
 esac

By experimentation I've found that I need both the "systemctl
daemon-reload" and the "systemctl start karaf",
and I don't know how to
replace this with the recommended dh_systemd_enable and
dh_systemd_start.

And what should I do about "deb-systemd-helper enable karaf.service"?

Remove it?

Is none of this needed if I change the default rule in the rules file to this?

%:
	dh $@ --with systemd

This is from the "Pragmatic Debian Packaging" article:
 https://vincent.bernat.im/en/blog/2016-pragmatic-debian-packaging

Thanks!


- Steinar


Reply to: