0

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.target

and here's the socket:

[Unit]
Description=NordVPN Daemon Socket
PartOf=nordvpnd.service

[Socket]
ListenStream=/run/nordvpnd.sock
NoDelay=true

[Install]
WantedBy=sockets.target
  • 1
    tried to create a service (...) but I failed - what did you try exactly? what was not working? did you look at other scripts in /etc/rc.d/ directory? btw. there are tools for installing rpm packages on Slackware. – rsm Aug 7 '19 at 13:08
  • @rsm the question is not about installing, the OP is asking people to write him a script. Some packages nowadays only come with systemd files. – Rui F Ribeiro Aug 8 '19 at 7:18
  • Actually, i could finally write a very simple script with 3 functions of start, restart and stop, and it works perfectly now. Anyway Thanks you guys – rezat4795 Aug 8 '19 at 12:35
  • Why did you switch to Slackware, if you need to run software that doesn't support it directly? – filbranden Aug 9 '19 at 6:00
1

That would probably something like this:

#!/bin/sh
NordVPN_start(){
    if [ -x /usr/sbin/nordvpnd ] ; then
        /usr/sbin/nordvpnd
    fi
}

NordVPN_stop(){
    /bin/killall NordVPN 2>/dev/null
}

case "$1" in
'start')
  NordVPN_start
  ;;
'stop')
  NordVPN_stop
  ;;
'reload')
  NordVPN_stop
  NordVPN_start
  ;;
'restart')
  NordVPN_stop
  NordVPN_start
  ;;

*) 
  echo "usage $0 start|stop|reload|restart"
esac
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.