SoftEther on Ubuntu 20.04 not auto starting

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
xodc
Posts: 31
Joined: Mon Nov 02, 2015 7:45 am

SoftEther on Ubuntu 20.04 not auto starting

Post by xodc » Thu May 26, 2022 2:07 pm

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!


xodc
Posts: 31
Joined: Mon Nov 02, 2015 7:45 am

Re: SoftEther on Ubuntu 20.04 not auto starting

Post by xodc » Thu May 26, 2022 4:10 pm

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

solo
Posts: 403
Joined: Sun Feb 14, 2021 10:31 am

Re: SoftEther on Ubuntu 20.04 not auto starting

Post by solo » Thu May 26, 2022 10:41 pm

Remove whatever you inserted into /etc/init.d and then enable the service.

xodc
Posts: 31
Joined: Mon Nov 02, 2015 7:45 am

Re: SoftEther on Ubuntu 20.04 not auto starting

Post by xodc » Fri May 27, 2022 1:17 am

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!

solo
Posts: 403
Joined: Sun Feb 14, 2021 10:31 am

Re: SoftEther on Ubuntu 20.04 not auto starting

Post by solo » 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"

xodc
Posts: 31
Joined: Mon Nov 02, 2015 7:45 am

Re: SoftEther on Ubuntu 20.04 not auto starting

Post by xodc » Fri May 27, 2022 5:31 am

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.

Post Reply