Be sure to get the correct PID

This commit is contained in:
Maniack Crudelis 2019-02-18 00:12:01 +01:00 committed by GitHub
parent 9052bb0b78
commit 631ca47636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,12 +96,14 @@ ynh_systemd_action() {
if [ "$log_path" == "systemd" ] ; then
# Read the systemd journal
journalctl --unit=$service_name --follow --since=-0 --quiet > "$templog" &
# Get the PID of the journalctl command
local pid_tail=$!
else
# Read the specified log file
tail -F -n0 "$log_path" > "$templog" &
# Get the PID of the tail command
local pid_tail=$!
fi
# Get the PID of the tail command
local pid_tail=$!
fi
echo "${action^} the service $service_name" >&2