Merge pull request #1222 from yalh76/ynh_systemd_action_stop

ynh_systemd_action: Fix case where service is already stopped
This commit is contained in:
Alexandre Aubin 2021-05-08 14:56:58 +02:00 committed by GitHub
commit 1757ce6012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,6 +88,12 @@ ynh_systemd_action() {
log_path="${log_path:-/var/log/$service_name/$service_name.log}"
timeout=${timeout:-300}
# Manage case of service already stopped
if [ "$action" == "stop" ] && ! systemctl is-active --quiet $service_name
then
return 0
fi
# Start to read the log
if [[ -n "$line_match" ]]
then