jpbn
(Jaap Bosman)
December 11, 2019, 9:47am
1
As far as I know systemd unit files do point to a script.sh (Am I correct?)
Is it possible to make a unit file for systemd with a command?
I would like to connect to a vpn with the command protonvpn c -X.
Like this:
[Service]
ExecStart=protonvpn c -X
Does systemd do that?
grumpey
(Joe Walker)
December 11, 2019, 11:57am
2
Yes it can.
I’m guessing you want to do something similiar to: https://www.x86txt.com/articles/protonvpn-cli-systemd.html
For Reference:
Welcome back to the systemd series, where we explore more about how this central part of your Fedora system works. This installment talks about unit files. As a long-time Fedora user, I hadn’t thought much about systemd actually worked until...
Increasingly, Linux distributions are adopting or planning to adopt the systemd init system. This powerful suite of software can manage many aspects of your server, from services to mounted devices and system states. In systemd, a unit refers to any...
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
Depending on what you’re trying to do you can set up system or user services as well.
3 Likes
jpbn
(Jaap Bosman)
December 13, 2019, 12:49pm
3
Well thanks for the answer.
Your solution is: point at a script or application and make that start.
My conclusion: in the unit one cannot use commands the same way one does in terminal. Always first point at an application.
Thanks again.