This commit is contained in:
OniriCorpe 2024-05-24 00:06:08 +02:00 committed by GitHub
commit b106c9fcdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,10 @@ ynh_add_systemd_config() {
ynh_add_config --template="$template" --destination="/etc/systemd/system/$service.service"
systemctl enable $service --quiet
if [[ ${YNH_APP_ACTION} == "install" ]]; then
systemctl enable $service --quiet
fi
systemctl daemon-reload
}
@ -88,6 +91,13 @@ ynh_systemd_action() {
return 0
fi
# do not start a service disabled by the user
if ([ "$action" == "start" ] || [ "$action" == "reload_or_restart" ] || [ "$action" == "restart" ]) && \
! systemctl --quiet is-enabled $service_name; then
echo "$service_name is disabled, therefore skipping action $action"
return 0
fi
# Start to read the log
if [[ -n "$line_match" ]]; then
local templog="$(mktemp)"