rootkiwi / an2linuxserver

Sync Android notifications encrypted to a Linux desktop
Other
401 stars 43 forks source link

systemd service does not work #28

Open J316 opened 7 years ago

J316 commented 7 years ago

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

rootkiwi commented 7 years ago

Try without sudo when using --user

J316 commented 7 years ago

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?

rootkiwi commented 7 years ago

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

popman commented 7 years ago

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

Worked for me, on Ubuntu.

J316 commented 7 years ago

@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

rootkiwi commented 7 years ago

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

and then reboot

popman commented 7 years ago

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.