From a1c6dbc249e944dba70aef513914f55ed01fb191 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Mar 2021 21:50:33 +0100 Subject: [PATCH] Fixing ynh_systemd_action --- scripts/actions/public_private | 2 +- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/actions/public_private b/scripts/actions/public_private index b3a263c..9512c4d 100755 --- a/scripts/actions/public_private +++ b/scripts/actions/public_private @@ -67,7 +67,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= ynh_script_progression --message="Reload nginx" -ynh_systemd_action --action=reload --service_name=nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index d9c3bf3..b1233d4 100644 --- a/scripts/install +++ b/scripts/install @@ -152,14 +152,14 @@ timeout=3600 echo "127.0.0.1 $domain #jenkins" | tee -a /etc/hosts # Wait for Jenkins to be fully started -ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" +ynh_systemd_action --service_name=$app --action="restart" --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" # Enable Jenkins CLI Protocol/2 for jenkins-cli # That the only protocol that allow connection without an authenticated user... ynh_replace_string --match_string="0" --replace_string="&\nCLI2-connect" --target_file=/var/lib/jenkins/config.xml # Wait for Jenkins to be fully started -ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" +ynh_systemd_action --service_name=$app --action="restart" --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" ynh_script_progression --message="Installing plugins..." --weight=60 @@ -180,7 +180,7 @@ done ynh_permission_update --permission="main" --remove="visitors" ynh_replace_string --match_string="true" --replace_string="false" --target_file=/var/lib/jenkins/config.xml -ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" +ynh_systemd_action --service_name=$app --action="restart" --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout" jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url%/}" diff --git a/scripts/upgrade b/scripts/upgrade index 6bac693..c71e9ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,7 +151,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Reloading NGINX web server..." --weight=2 -ynh_systemd_action --action=reload --service_name=nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # CHECK JENKINS STARTING @@ -159,7 +159,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Jenkins..." --weight=25 # Wait for Jenkins to be fully started -ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" +ynh_systemd_action --service_name=$app --action="restart" --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" #================================================= # DEACTIVE MAINTENANCE MODE @@ -183,7 +183,7 @@ ynh_script_progression --message="Upgrading plugins..." --weight=40 cp /var/lib/jenkins/config.xml /var/lib/jenkins/config.xml.bak ynh_replace_string --match_string="true" --replace_string="false" --target_file=/var/lib/jenkins/config.xml -ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" +ynh_systemd_action --service_name=$app --action="restart" --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url%/}" UPDATE_LIST=$($jenkins_cli list-plugins | grep -e ')$' | awk '{ print $1 }' )