4

I have created a debian package for one of my autotool project.I don't have any problem in debian creation and installation.The problem is that debian includes a systemd service file and I'm installing it to /usr/lib/systemd/user/ but after installing the debian I'm not able to enable that service(unit file).

I tried adding

%: 
      dh $@ --with autoreconf --with-systemd

in debian rules file but it's not working.So is there any other way that I can enable the systemd service after installing my debian.

Note: No problem in the service file I can manually enable it after installing the debian using systemctl command.

  • Is the goal to get the service to start up after install? If your debian has a postinst maintainer script, and it isn't written properly, it can suddenly disables the auto-enable and start of services after install: unix.stackexchange.com/questions/423069/… – Wimateeka Feb 12 '18 at 13:24
2

Is not very clean, but you can create a soft link to the service in the folder

/etc/systemd/system/multi-user.target.wants/

For example:

ln -s /etc/systemd/system/multi-user.target.wants/yourservice.service /usr/lib/systemd/user/yourservice.service
  • Thank you for your reply. Yeah, now I'm doing the same thing in the post installation script of my debian. But I want to avoid this. dh is providing the option to add it in the debian rules file(--with-systemd) but it's not working for me. :( – Thushi Dec 10 '14 at 9:48
  • isn't it --with systemd the right syntax? not working for me neither :( – FlogFR Aug 2 '15 at 8:58
2

The right syntax is --with systemd , although --with=systemd also works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.