Debian – Enable systemd service file

debiandebian-installersystemd

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.

Best Answer

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