From b3e165a4530b5cb61cee9a5fc3923f756588e06f Mon Sep 17 00:00:00 2001 From: ewilly Date: Mon, 3 Apr 2023 09:08:54 +0200 Subject: [PATCH] Fix --- conf/config/collector.yaml | 2 +- manifest.toml | 2 +- scripts/install | 5 +++-- scripts/restore | 22 +++++++++------------- scripts/upgrade | 8 +++++--- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/conf/config/collector.yaml b/conf/config/collector.yaml index dd8f451..f568d0f 100644 --- a/conf/config/collector.yaml +++ b/conf/config/collector.yaml @@ -66,10 +66,10 @@ log: level: INFO api: -# endpoint: 'https://__DOMAIN____PATH__/' endpoint: 'http://127.0.0.1:__PORT____PATH__/' # if you need to use a custom base path (for a reverse proxy), you can add a suffix to the endpoint. # See docs/TROUBLESHOOTING_REVERSE_PROXY.md for more info, +# endpoint: 'https://__DOMAIN____PATH__/' # example to show how to override the smartctl command args globally #commands: diff --git a/manifest.toml b/manifest.toml index 21d529d..1c62fae 100644 --- a/manifest.toml +++ b/manifest.toml @@ -4,7 +4,7 @@ id = "scrutiny" name = "Scrutiny" description.en = "WebUI for smartd S.M.A.R.T monitoring" -version = "0.6.0~ynh2" +version = "0.6.0~ynh3" maintainers = ["ewilly"] diff --git a/scripts/install b/scripts/install index 1b5f4e5..d10f47c 100755 --- a/scripts/install +++ b/scripts/install @@ -83,12 +83,13 @@ myynh_set_permissions ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name="influxdb" --action="enable" ynh_systemd_action --service_name="influxdb" --action="start" + +ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" + if [ $collector -eq 1 ] then systemctl daemon-reload - ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable" - ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" fi diff --git a/scripts/restore b/scripts/restore index 9e1dd5e..7665e4c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,16 +26,9 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-web-server.service" -systemctl enable "/etc/systemd/system/scrutiny-web-server.service" --quiet ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.service" ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.timer" -yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" -if [ $collector -eq 1 ] -then - yunohost service add "scrutiny-collector" --description="Collector running on timer (daily) for smartd S.M.A.R.T monitoring" --log="/var/log/$app/collector.log" --test_status="systemctl show scrutiny-collector.service -p ActiveState --value | grep -v failed" -fi - ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/var/log/$app" @@ -46,20 +39,23 @@ ynh_restore_file --origin_path="/var/log/$app" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -# Typically you only have either $app or php-fpm but not both at the same time... +systemctl daemon-reload +ynh_systemd_action --service_name="nginx" --action="reload" + +ynh_systemd_action --service_name="influxdb" --action="enable" ynh_systemd_action --service_name="influxdb" --action="start" + +systemctl enable "/etc/systemd/system/scrutiny-web-server.service" --quiet +yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" + if [ $collector -eq 1 ] then - systemctl daemon-reload - ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable" - ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log" + yunohost service add "scrutiny-collector" --description="Collector running on timer (daily) for smartd S.M.A.R.T monitoring" --log="/var/log/$app/collector.log" --test_status="systemctl show scrutiny-collector.service -p ActiveState --value | grep -v failed" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" fi -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index da81cdb..6f5231d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,14 +100,16 @@ myynh_set_permissions # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 + +systemctl daemon-reload + ynh_systemd_action --service_name="influxdb" --action="enable" ynh_systemd_action --service_name="influxdb" --action="start" + +ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" if [ $collector -eq 1 ] then - systemctl daemon-reload - ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable" - ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" fi