From c730d36ed44190dc55a518f63c177315247bbda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 24 Jun 2020 12:24:12 +0200 Subject: [PATCH] Disable systemd service --- cluster/maco.remove.jobs.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/cluster/maco.remove.jobs.sh b/cluster/maco.remove.jobs.sh index 3823c60..e83446a 100755 --- a/cluster/maco.remove.jobs.sh +++ b/cluster/maco.remove.jobs.sh @@ -70,14 +70,31 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t remove_cron() { # {{{ debug_message "remove_cron − \ -Try to remove cron jobs (autoupdate, benchmark,…)." +Try to remove maco's cron jobs (autoupdate, benchmark,…)." - # Remove default Maco cron that check updates + ## Remove default Maco cron that check updates rm -f /etc/cron.daily/ipr_autoupdate - # and benchmark + ## and benchmark rm -f /etc/cron.daily/ipr_benchmark +} +# }}} +manage_systemd_service() { # {{{ + + maco_service_name="maco.service" + + ## If maco.service is enable + ## Disable it at boot + systemctl --quiet is-enabled "${maco_service_name}" \ + && debug_message "manage_systemd_service − Try to disable ${maco_service_name}." \ + && systemctl --quiet disable "${maco_service_name}" > /dev/null 2>&1 + + ## After a Maco's upgrade, the service should be set. + ## If this upgrade require reboot, then the service should be run + ## at the next boot + ## It will be re-disable by this script after the upgrade. + } # }}} main() { # {{{ @@ -91,6 +108,8 @@ main() { # {{{ remove_cron + manage_systemd_service + } # }}}