Startup Script for vpnserver on Ubuntu 16.04

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Mada
Posts: 102
Joined: Sat Jun 20, 2015 9:40 am

Startup Script for vpnserver on Ubuntu 16.04

Post by Mada » Thu May 12, 2016 6:47 pm

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

qupfer
Posts: 202
Joined: Wed Jul 10, 2013 2:07 pm

Re: Startup Script for vpnserver on Ubuntu 16.04

Post by qupfer » Fri May 13, 2016 6:00 pm

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

Mada
Posts: 102
Joined: Sat Jun 20, 2015 9:40 am

Re: Startup Script for vpnserver on Ubuntu 16.04

Post by Mada » Fri May 13, 2016 7:39 pm

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

Post Reply