0

I am running Ubuntu Server 22.04 in a VMware Workstation VM (Host OS is Windows 11 Pro).

I find that I have to manually start the Softether VPN by running "/etc/init.d/vpnserver start". So at least it installed correctly

I tried running "update-rc.d vpnserver defaults" to make it autostart after login to no avail.

I tried this guide,: https://www.digitalocean.com/community/questions/softether-is-not-starting-after-reboot

However, the problem is when I go enable the service with sudo systemctl enable vpnserver.service, it gives me an error:

update-rc.d: error: vpnserver Default-Start contains no runlevels, aborting

I tried 3 variations:

#1 "sudo nano /etc/init.d/vpnserver"


> #!/bin/sh
> # chkconfig: 2345 99 01
> # description: SoftEther VPN Server sleep 10 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 /etc/init.d/vpnserver start exit 0

#2 (with code below) "sudo nano /etc/systemd/system/vpnserver.service"

-- and--

#3 (with code below) "nano /lib/systemd/system/vpnserver.service"

Description=SoftEther VPN Server
After=network.target


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


[Install]
WantedBy=multi-user.target

Any ideas? Thanks!

1 Answer 1

0

I followed the same guide and had the same issue, but was able to get the service to start on boot by adding a ### BEGIN INIT INFO block to the vpnserver file in init.d and then re-running the systemctl enable command.

sudo nano /etc/init.d/vpnserver

Added the ### BEGIN INIT INFO / ### END INIT INFO block to the top of the file, right after the #!/bin/sh line. The rest of the file is the same as it was in the guide.

#!/bin/sh
### BEGIN INIT INFO
# Provides:             vpnserver
# Required-Start:
# Required-Stop:
# Default-Start:        2 3 4 5
# Default-Stop:
# Short-Description:    SoftEtherVPNServer
### END INIT INFO

# 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

Then run the enable command again,

systemctl enable vpnserver.service

after which the VPN service starts automatically when I reboot the server.

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.