derrix060 / onedriveClient

A Microsoft OneDrive and OneDrive for Business client for Linux, written in Python3.
MIT License
65 stars 10 forks source link

Systemd Service #20

Open modelmat opened 5 years ago

modelmat commented 5 years ago

Similar to https://github.com/xybu/onedrived-dev/issues/47, is this possible?

modelmat commented 5 years ago
[Unit]
Description=A Microsoft OneDrive client for Linux, written in Python3.
Documentation=https://github.com/derrix060/onedriveClient
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/onedrived start --debug
ExecStop=/usr/bin/onedrived stop
ExecReload=/usr/bin/onedrived restart

[Install]
WantedBy=multi-user.target

This seems to work for me, is this fine? Also should this be added via the script? Where?

derrix060 commented 5 years ago

I will test it tonight.

For sure it needs to be added via script, I'm not sure yet how...

modelmat commented 5 years ago

According to https://www.freedesktop.org/software/systemd/man/systemd.unit.html, these are the directories it can be in. image I think it's usually /usr/lib/systemd/user/ is for user services, so it should go there (though this needs sudo still). Maybe we should leave it up to the user to install it?

derrix060 commented 5 years ago

I would prefer to install on ~/.config/systemd/user/ because you wouldn't require sudo access and it can be installed by user basis.

modelmat commented 5 years ago

I can see that very well... Okay then, I'll see if I can get that working.

modelmat commented 5 years ago

The AUR package now installs the systemctl script. (https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=onedrive-client-git)

derrix060 commented 5 years ago

That's nice. Can you add a stage on the travis CI to prove that it works and no one will break this?

modelmat commented 5 years ago

I'm not sure how to. AFAIK, unless we change the onedrive-client start and stop commands it should stay the same, so I'm also not sure what you're asking.

derrix060 commented 5 years ago

My point is only to validade that the AUR package is installing correct and it works

modelmat commented 5 years ago

I don't think it's possible to install AUR packages on Travis as it uses an entirely different packaging system. Unless we use something like https://github.com/mikkeloscar/arch-travis, which I have no idea how well it works.