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

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



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.

> 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


Reply to: