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, 2018 at 13:24

2 Answers 2


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


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, 2014 at 9:48
  • isn't it --with systemd the right syntax? not working for me neither :(
    – FlogFR
    Aug 2, 2015 at 8:58
  • I think the example syntax is wrong. it should be "ln - s <target> <link-name>". ie. ln -s /usr/lib/systemd/user/yourservice.service /etc/systemd/system/multi-user.target.wants/yourservice.service
    – mp035
    Jun 17, 2021 at 7:28

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.