From 35ffadbe1c7f5967a485f1282257d7244e9641f1 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Mon, 28 Jan 2019 16:26:43 +0100 Subject: [PATCH] Use ynh_systemd_action for backend helpers --- data/helpers.d/backend | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index e73644d2d..8d353365d 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -117,10 +117,10 @@ ynh_remove_systemd_config () { local finalsystemdconf="/etc/systemd/system/$service_name.service" if [ -e "$finalsystemdconf" ]; then - sudo systemctl stop $service_name - sudo systemctl disable $service_name + ynh_systemd_action --service_name=$service_name --action=stop + systemctl disable $service_name ynh_secure_remove "$finalsystemdconf" - sudo systemctl daemon-reload + systemctl daemon-reload fi } @@ -186,7 +186,7 @@ ynh_add_nginx_config () { ynh_store_file_checksum "$finalnginxconf" - sudo systemctl reload nginx + ynh_systemd_action --service_name=nginx --action=reload } # Remove the dedicated nginx config @@ -194,7 +194,7 @@ ynh_add_nginx_config () { # usage: ynh_remove_nginx_config ynh_remove_nginx_config () { ynh_secure_remove "/etc/nginx/conf.d/$domain.d/$app.conf" - sudo systemctl reload nginx + ynh_systemd_action --service_name=nginx --action=reload } # Create a dedicated php-fpm config @@ -229,7 +229,7 @@ ynh_add_fpm_config () { sudo chown root: "$finalphpini" ynh_store_file_checksum "$finalphpini" fi - sudo systemctl reload $fpm_service + ynh_systemd_action --service_name=$fpm_service --action=reload } # Remove the dedicated php-fpm config @@ -245,5 +245,5 @@ ynh_remove_fpm_config () { fi ynh_secure_remove "$fpm_config_dir/pool.d/$app.conf" ynh_secure_remove "$fpm_config_dir/conf.d/20-$app.ini" 2>&1 - sudo systemctl reload $fpm_service + ynh_systemd_action --service_name=$fpm_service --action=reload }