Browse Source

install logrotate config

HgO 4 months ago
parent
commit
6552b6c8da
4 changed files with 7 additions and 0 deletions
  1. 2 0
      scripts/install
  2. 1 0
      scripts/remove
  3. 2 0
      scripts/restore
  4. 2 0
      scripts/upgrade

+ 2 - 0
scripts/install

@@ -34,6 +34,8 @@ systemctl stop openvpn
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service enable $service_name
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+
 # checker service
 
 systemctl start $service_checker_name

+ 1 - 0
scripts/remove

@@ -16,6 +16,7 @@ systemctl disable $service_checker_name --quiet
 if ynh_exec_warn_less yunohost service status $service_name >/dev/null; then
     yunohost service remove $service_name
 fi
+ynh_remove_logrotate
 
 for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*); do
     ynh_secure_remove "$FILE"

+ 2 - 0
scripts/restore

@@ -28,6 +28,8 @@ systemctl stop openvpn
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 yunohost service enable "$service_name"
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+
 # checker service
 
 systemctl start "$service_checker_name"

+ 2 - 0
scripts/upgrade

@@ -128,6 +128,8 @@ ynh_print_info "Configuring VPN client services..."
 # main service
 yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
 
+ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
+
 # checker service (this service was previously integrated in yunohost but we do not do this anymore)
 if ynh_exec_warn_less yunohost service status $service_checker_name >/dev/null
 then