diff --git a/helpers/helpers.v2.1.d/fail2ban b/helpers/helpers.v2.1.d/fail2ban index f27a32626..a382d5dce 100644 --- a/helpers/helpers.v2.1.d/fail2ban +++ b/helpers/helpers.v2.1.d/fail2ban @@ -105,7 +105,7 @@ ignoreregex = chown -R "$app:$app" "/var/log/$app" chmod -R u=rwX,g=rX,o= "/var/log/$app" - ynh_systemd_action --service=fail2ban --action=reload --wait_until="(Started|Reloaded) Fail2Ban Service" --log_path=systemd + ynh_systemctl --service=fail2ban --action=reload --wait_until="(Started|Reloaded) Fail2Ban Service" --log_path=systemd local fail2ban_error="$(journalctl --no-hostname --unit=fail2ban | tail --lines=50 | grep "WARNING.*$app.*")" if [[ -n "$fail2ban_error" ]]; then @@ -122,5 +122,5 @@ ignoreregex = ynh_config_remove_fail2ban() { ynh_safe_rm "/etc/fail2ban/jail.d/$app.conf" ynh_safe_rm "/etc/fail2ban/filter.d/$app.conf" - ynh_systemd_action --service=fail2ban --action=reload + ynh_systemctl --service=fail2ban --action=reload } diff --git a/helpers/helpers.v2.1.d/mongodb b/helpers/helpers.v2.1.d/mongodb index 8f50ede59..370b88d92 100644 --- a/helpers/helpers.v2.1.d/mongodb +++ b/helpers/helpers.v2.1.d/mongodb @@ -241,7 +241,7 @@ ynh_install_mongo() { # Make sure MongoDB is started and enabled systemctl enable $mongodb_servicename --quiet systemctl daemon-reload --quiet - ynh_systemd_action --service=$mongodb_servicename --action=restart --wait_until="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log" + ynh_systemctl --service=$mongodb_servicename --action=restart --wait_until="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log" # Integrate MongoDB service in YunoHost yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log" diff --git a/helpers/helpers.v2.1.d/nginx b/helpers/helpers.v2.1.d/nginx index 3eb6bf212..59899600c 100644 --- a/helpers/helpers.v2.1.d/nginx +++ b/helpers/helpers.v2.1.d/nginx @@ -30,7 +30,7 @@ ynh_config_add_nginx() { ynh_store_file_checksum "$finalnginxconf" - ynh_systemd_action --service=nginx --action=reload + ynh_systemctl --service=nginx --action=reload } # Remove the dedicated nginx config @@ -40,7 +40,7 @@ ynh_config_add_nginx() { # Requires YunoHost version 2.7.2 or higher. ynh_config_remove_nginx() { ynh_safe_rm "/etc/nginx/conf.d/$domain.d/$app.conf" - ynh_systemd_action --service=nginx --action=reload + ynh_systemctl --service=nginx --action=reload } diff --git a/helpers/helpers.v2.1.d/php b/helpers/helpers.v2.1.d/php index b47259ac5..b72f16737 100644 --- a/helpers/helpers.v2.1.d/php +++ b/helpers/helpers.v2.1.d/php @@ -141,7 +141,7 @@ pm.process_idle_timeout = 10s ynh_safe_rm "$fpm_config_dir/pool.d/$app.conf" ynh_die "The new configuration broke php-fpm?" fi - ynh_systemd_action --service=$fpm_service --action=reload + ynh_systemctl --service=$fpm_service --action=reload } # Remove the dedicated PHP-FPM config @@ -153,7 +153,7 @@ ynh_config_remove_phpfpm() { local fpm_config_dir=$(ynh_app_setting_get --key=fpm_config_dir) ynh_safe_rm "$fpm_config_dir/pool.d/$app.conf" - ynh_systemd_action --service="php${php_version}-fpm" --action=reload + ynh_systemctl --service="php${php_version}-fpm" --action=reload } # Define the values to configure PHP-FPM diff --git a/helpers/helpers.v2.1.d/systemd b/helpers/helpers.v2.1.d/systemd index b7aa0508e..13b6cc293 100644 --- a/helpers/helpers.v2.1.d/systemd +++ b/helpers/helpers.v2.1.d/systemd @@ -35,7 +35,7 @@ ynh_config_add_systemd() { ynh_config_remove_systemd() { local service="${1:-$app}" if [ -e "/etc/systemd/system/$service.service" ]; then - ynh_systemd_action --service=$service --action=stop + ynh_systemctl --service=$service --action=stop systemctl disable $service --quiet ynh_safe_rm "/etc/systemd/system/$service.service" systemctl daemon-reload @@ -44,7 +44,7 @@ ynh_config_remove_systemd() { # Start (or other actions) a service, print a log in case of failure and optionnaly wait until the service is completely started # -# usage: ynh_systemd_action [--service=service] [--action=action] [ [--wait_until="line to match"] [--log_path=log_path] [--timeout=300] [--length=20] ] +# usage: ynh_systemctl [--service=service] [--action=action] [ [--wait_until="line to match"] [--log_path=log_path] [--timeout=300] [--length=20] ] # | arg: -n, --service= - Name of the service to start. Default : `$app` # | arg: -a, --action= - Action to perform with systemctl. Default: start # | arg: -w, --wait_until= - The pattern to find in the log to attest the service is effectively fully started. @@ -53,7 +53,7 @@ ynh_config_remove_systemd() { # | arg: -e, --length= - Length of the error log displayed for debugging : Default : 20 # # Requires YunoHost version 3.5.0 or higher. -ynh_systemd_action() { +ynh_systemctl() { # ============ Argument parsing ============= local -A args_array=([n]=service= [a]=action= [w]=wait_until= [p]=log_path= [t]=timeout= [e]=length=) local service