Disable systemd service

This commit is contained in:
Jeremy Gardais 2020-06-24 12:24:12 +02:00
parent 0141ec027b
commit c730d36ed4
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 22 additions and 3 deletions

View File

@ -70,14 +70,31 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t
remove_cron() { # {{{ remove_cron() { # {{{
debug_message "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 rm -f /etc/cron.daily/ipr_autoupdate
# and benchmark ## and benchmark
rm -f /etc/cron.daily/ipr_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() { # {{{ main() { # {{{
@ -91,6 +108,8 @@ main() { # {{{
remove_cron remove_cron
manage_systemd_service
} }
# }}} # }}}