Page 1 of 1

Startup Script for vpnserver on Ubuntu 16.04

Posted: Thu May 12, 2016 6:47 pm
by Mada
The script in the manual is for CentOS and does not work well on Ubuntu.

Has anyone done one for Ubuntu 16.04?

Thanks,

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

Re: Startup Script for vpnserver on Ubuntu 16.04

Posted: Fri May 13, 2016 6:00 pm
by qupfer
I use a "quick & dirty" systemd service.
(to activate: "sudo systemctl enable vpn" to start once: "sudo systemctl start vpn")

qupfer@vpnpi:~ $ cat /etc/systemd/system/vpn.service
[Unit]
Description=SoftEther VPN Server daemon
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/vpnserver start
ExecStop=/usr/bin/vpnserver stop

[Install]
WantedBy=multi-user.target

Re: Startup Script for vpnserver on Ubuntu 16.04

Posted: Fri May 13, 2016 7:39 pm
by Mada
Thanks,

I tried to fix this by adding:

### BEGIN INIT INFO
# Provides: vpnserver
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and Stop
# Description:
### END INIT INFO

but managed to break it by doing so..... and now I cant reach the server. Have to go there...