an2linuxserver icon indicating copy to clipboard operation
an2linuxserver copied to clipboard

systemd service does not work

Open J316 opened this issue 8 years ago • 7 comments

I followed the guide step by step, changed the path (in my case /usr/bin/an2linuxserver.py), created ~/.config/systemd/user folder. When I execute sudo systemctl --user start an2linux.service I get Failed to start an2linux.service: Unit an2linux.service not found. If I add it to /usr/lib/systemd/system/an2linux.service I can get it enabled and started, but it doesn't work, I even changed from WantedBy=default.target to WantedBy=multi-user.target but it doesn't work. This happens on manjaro (Arch) Linux, I correctly installed an2linuxserver-git from AUR. If I simply run an2linuxserver.py in a terminal it does work

J316 avatar Feb 21 '17 21:02 J316

Try without sudo when using --user

rootkiwi avatar Feb 24 '17 14:02 rootkiwi

Same output. Why should the service be in a folder named "user", in a systemd folder in the .config folder of the home directory? Is systemctl supposed to look in there with the --user flag?

J316 avatar Feb 24 '17 15:02 J316

Okey then I dont know what the problem is sorry. Yes it is, more info here that may be able to help: https://wiki.archlinux.org/index.php/Systemd/User

rootkiwi avatar Feb 24 '17 15:02 rootkiwi

Try running systemctl --user enable ~/.config/systemd/user/an2linux.service first.

Worked for me, on Ubuntu.

popman avatar Mar 18 '17 06:03 popman

@popman that way (without the sudo) the service can be enabled, but not started and the status checking reports it cannot be found. After reboot it's not started as well and cannot be disabled. I wonder why it doesn't reports error messages since the command obviously doesn't work

J316 avatar Mar 18 '17 10:03 J316

Maybe try this: sudo loginctl enable-linger <your-username>

and then reboot

rootkiwi avatar Mar 18 '17 11:03 rootkiwi

What OS are you on?

The status command shows that service running for me, after I started it manually.

Running systemctl --user status an2linux.service gave me specific error messages for when it failed to start.

On my system, after running systemctl --user enable on the location of the service file, a file at ~/.config/systemd/user/default.target.wants/an2linux.service was created.

systemd is garbage, but it should be able to do this at least.

On 18/03/17 10:33, J316 wrote:

@popman https://github.com/popman that way (without the sudo) the service can be enabled, but not started and the status checking reports it cannot be found. After reboot it's not started as well and cannot be disabled. I wonder why it doesn't reports error messages since the command obviously doesn't work

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rootkiwi/an2linuxserver/issues/28#issuecomment-287533972, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxj5tWB56svmz6bOV-XPJ4LDVSNXrqxks5rm7MJgaJpZM4MH39t.

popman avatar Mar 18 '17 15:03 popman