Parcourir la source

systemd: migrate the SySv init script to a simple bash script

Sebastien Badia il y a 10 ans
Parent
commit
52254fad0e
3 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 0 0
      conf/ynh-vpnclient
  2. 2 1
      scripts/install
  3. 1 1
      scripts/remove

conf/init_ynh-vpnclient → conf/ynh-vpnclient


+ 2 - 1
scripts/install

@@ -162,7 +162,8 @@ sudo sed 's|<TPL:NGINX_REALPATH>|/var/www/vpnadmin/|g' -i /etc/php5/fpm/pool.d/v
 sudo sed "s|<TPL:NGINX_LOCATION>|${url_path}|g" -i /var/www/vpnadmin/config.php
 
 # Copy init script
-sudo install -o root -g root -m 0755 ../conf/init_ynh-vpnclient /etc/init.d/ynh-vpnclient
+sudo install -o root -g root -m 0755 ../conf/ynh-vpnclient /usr/local/bin/
+sudo install -o root -g root -m 0755 ../conf/ynh-vpnclient.service /lib/systemd/system/ynh-vpnclient.service
 
 # Set default inits
 # The openvpn configuration is modified before the start, so the service is disabled by default

+ 1 - 1
scripts/remove

@@ -23,7 +23,7 @@ domain=$(sudo yunohost app setting vpnclient domain)
 # The End
 sudo systemctl stop ynh-vpnclient --quiet
 sudo yunohost service remove ynh-vpnclient
-sudo rm -f /etc/init.d/ynh-vpnclient
+sudo rm -f /lib/systemd/system/ynh-vpnclient.service
 sudo rm -f /tmp/.ynh-vpnclient-*
 
 # Remove confs