Page 1 of 1

Restarting OpenVPN Server

Posted: Tue Jun 07, 2011 11:46 pm
by ScKaSx444
Hi All,

I am trying to debug my configuration files for a client-server setup, where (client=my laptop, Windows 7) and (server=NAS hard drive, Linux). When I make changes to the server configuration I would like to restart the OpenVPN server. To do this is it okay to just run from the command line:

Code: Select all

openvpn new_config.config
It is not necessary to power cycle the hard drive, correct? I appreciate the help.

Re: Restarting OpenVPN Server

Posted: Wed Jun 08, 2011 7:37 am
by Bebop
Power cycle is definitely not necessary. The exact method you use will depend on your OS, and whether you start as a service or not.

Centos service:

Code: Select all

service openvpn restart
Debian service:

Code: Select all

/etc/init.d/openvpn restart
In your case:

Code: Select all

openvpn new_config.config
are you stopping the old instance first? (ctrl+c)

If yes, then you are doing all that is required. Nothing further required.

Re: Restarting OpenVPN Server

Posted: Thu Jun 16, 2011 5:08 pm
by ScKaSx444
Hi Bebop,

Thanks for the response, great name btw as it was also a great show.

I read about stopping the service with ctrl-c but I can't tell if that does anything when I do that. Can I check 'jobs' or 'processes' in linux to see if it is/isn't running in the background? Does linux have a restart function like with Debian or Centos?

Thx again!

Re: Restarting OpenVPN Server

Posted: Fri Jun 17, 2011 7:37 am
by janjust
this depends on your linux distro; the centos+debian scripts are wrappers around the openvpn command itself; if openvpn is launched from the command line without using 'deamon' then a CTRL+C is sufficient; if openvpn is daemonized you can find the processes using

Code: Select all

ps -elf | grep openvpn
a quick&dirty way to kill all openvpn processes is

Code: Select all

killall openvpn
but again, this depends a bit on the linux distro used on the NAS box.

Re: Restarting OpenVPN Server

Posted: Thu Jun 03, 2021 3:00 pm
by david01
to restart the service
if you on Redhat or CentOS
[root@localhost ~]# systemctl list-units --type service //to check service name
[root@localhost ~]# systemctl status openvpn-server@server.service // for me the service is "openvpn-server@server.service"
[root@localhost ~]# systemctl restart openvpn-server@server.service // to restart the service

i hope that will help