diff --git a/data/helpers.d/systemd b/data/helpers.d/systemd index 4b3b5a289..105678b88 100644 --- a/data/helpers.d/systemd +++ b/data/helpers.d/systemd @@ -165,9 +165,15 @@ ynh_systemd_action() { # # usage: ynh_clean_check_starting ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 + if [ -n "$pid_tail" ] + then + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + fi + if [ -n "$templog" ] + then + ynh_secure_remove "$templog" 2>&1 + fi }