Openvpn restarts on failure thanks to systemd

This commit is contained in:
Julien Vaubourg 2015-09-28 15:28:44 +02:00
parent 7b05614b3c
commit 9bc83f4f6a
3 changed files with 7 additions and 0 deletions

5
conf/openvpn@.service Normal file
View File

@ -0,0 +1,5 @@
.include /lib/systemd/system/openvpn@.service
[Service]
Restart=always
RestartSec=1

View File

@ -87,6 +87,7 @@ sudo install -o root -g root -m 0644 ../conf/openvpn_client.conf.tpl /etc/openvp
sudo install -b -o root -g root -m 0644 ../conf/nginx_vpnadmin.conf "/etc/nginx/conf.d/${domain}.d/vpnadmin.conf"
sudo install -b -o root -g root -m 0644 ../conf/phpfpm_vpnadmin.conf /etc/php5/fpm/pool.d/vpnadmin.conf
sudo install -b -o root -g root -m 0755 ../conf/hook_post-iptable-rules /etc/yunohost/hooks.d/90-vpnclient.tpl
sudo install -b -o root -g root -m 0644 ../conf/openvpn@.service /etc/systemd/system/
# Copy web sources
sudo mkdir -pm 0755 /var/www/vpnadmin/

View File

@ -32,6 +32,7 @@ sudo rm -f /etc/openvpn/client.conf{.tpl,.tpl.restore,}
sudo rm -f /etc/nginx/conf.d/${domain}.d/vpnadmin.conf
sudo rm -f /etc/php5/fpm/pool.d/vpnadmin.conf
sudo rm -f /etc/yunohost/hooks.d/90-vpnclient.tpl
sudo rm -f /etc/systemd/system/openvpn@.service
# Remove certificates
sudo rm -rf /etc/openvpn/keys/