Page 1 of 1
SoftEther on Ubuntu 20.04 not auto starting
Posted: Thu May 26, 2022 2:07 pm
by xodc
I am running Ubuntu 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".
I tried running "update-rc.d vpnserver defaults" to make it autostart after login to no avail.
Any ideas? Thanks!
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Thu May 26, 2022 3:06 pm
by solo
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Thu May 26, 2022 4:10 pm
by xodc
I tried this guide, which shows something similar:
https://www.digitalocean.com/community/ ... ter-reboot
However, the problem is when I go enable the service with
Code: Select all
sudo systemctl enable vpnserver.service
It gives me an error:
Code: Select all
update-rc.d: error: vpnserver Default-Start contains no runlevels, aborting
I tried all 3 variations:
"sudo nano /etc/init.d/vpnserver"
Code: Select all
#!/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
"sudo nano
/etc/systemd/system/vpnserver.service"
-- and--
"nano
/lib/systemd/system/vpnserver.service"
Code: Select all
[Unit]
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
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Thu May 26, 2022 10:41 pm
by solo
Remove whatever you inserted into /etc/init.d and then enable the service.
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Fri May 27, 2022 1:17 am
by xodc
solo wrote: ↑Thu May 26, 2022 10:41 pm
Remove whatever you inserted into /etc/init.d and then enable the service.
Sorry, I’m rather a newb at Linux. Do you mean I should delete the file I made at “sudo nano /etc/init.d/vpnserver”?
And after that, how do I “enable the service”? Thanks!
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Fri May 27, 2022 2:12 am
by solo
Yes, just delete /etc/init.d/vpnserver
Then, "/lib/systemd/system/vpnserver.service" is already created and all it needs is "systemctl enable vpnserver"
Re: SoftEther on Ubuntu 20.04 not auto starting
Posted: Fri May 27, 2022 5:31 am
by xodc
solo wrote: ↑Fri May 27, 2022 2:12 am
Yes, just delete /etc/init.d/vpnserver
Then, "/lib/systemd/system/vpnserver.service" is already created and all it needs is "systemctl enable vpnserver"
Thank you so much. That worked out great.