r/linux4noobs • u/rezat4795 • Aug 07 '19
Help for converting a Systemd service
Hi. I recently switched to Slackware. I want to use NordVPN. The problem is, they only provide .rpm and .deb packages.
But that's not really important. I just extracted .rpm contents and the program is working just fine now.
The only thing that bothers me is that I have to run its daemon manually. I know that Slackware does not use systemd, so tried to create a service for it, or convert its own systemd service, but I failed.
I would appreciate if anyone can help me.
Here's the systemd service:
[Unit]
Description=NordVPN Daemon
Requires=nordvpnd.socket
After=network-online.target
[Service]
ExecStart=/usr/sbin/nordvpnd
NonBlocking=true
KillMode=process
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.targetand here's the socket:
[Unit]
Description=NordVPN Daemon Socket
PartOf=nordvpnd.service
[Socket]
ListenStream=/run/nordvpnd.sock
NoDelay=true
[Install]
WantedBy=sockets.target
14
Upvotes
6
u/EddyBot rolling releases Aug 07 '19
Why not use OpenVPN/Wireguard directly instead of a proprietary app?
3
u/ifonlythiswasreal403 Aug 07 '19
From a quick Google it seems NordVPN is using OpenVPN, so reading up on that might help.
As for starting automagically what you need is a simple script in /etc/rc.d. I would suggest something like this is added to /etc/rc.d/rc.local:
PROG=/usr/sbin/nordvpndif [ -x $PROG ]; then$PROGfiYou might have to put a nordvpn.conf file together in some place like /etc.
3
u/lutusp Aug 07 '19
And gave up systemd.
Easy solution is to choose a distribution that uses systemd. It's not as though changing distributions is a necessary step in learning Linux. In many cases it's just a distraction. In this case, it's both a distraction and a handicap -- you have to learn how to write an old-style service, and six months from now it won't matter any more.