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

Re: How should the systemd setup in a postinst script look?



Hi,

On Fri, 26 Jan 2018 09:56:28 +0200, Eugene Zhukov <eugene@debian.org> wrote:
> On Thu, Jan 25, 2018 at 11:21 PM, Steinar Bang <sb@dod.no> wrote:
> > 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.
> >
> The service will be enabled and started automatically upon package
> install, you don't need to do that.
> 
> Just put your <package_name>.service file into debian/ folder and the
> rest will be handled by Debian tools.
> The line in debian/rules quoted below is also needed. Don't forget to
> add dh-systemd into build-depends of your package.

since compatibility level 10, systemd module is used by default, so you
shouldn't need that. Though one have to Build-Depend on debhelper 10 at
least. There are more details in the man page of debhelper.

> > 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
> 
> Hope that helps,
> Eugene
> 

Attachment: pgpHneen0AM85.pgp
Description: PGP signature


Reply to: