mirror of
https://github.com/YunoHost-Apps/lstu_ynh.git
synced 2024-09-03 19:36:12 +02:00
Update helper
This commit is contained in:
parent
eef4e48112
commit
0c8fce0b2c
1 changed files with 9 additions and 9 deletions
|
@ -33,22 +33,22 @@ ynh_systemd_action() {
|
||||||
if [[ -n "${line_match:-}" ]]
|
if [[ -n "${line_match:-}" ]]
|
||||||
then
|
then
|
||||||
local templog="$(mktemp)"
|
local templog="$(mktemp)"
|
||||||
# Following the starting of the app in its log
|
# Following the starting of the app in its log
|
||||||
if [ "$log_path" == "systemd" ] ; then
|
if [ "$log_path" == "systemd" ] ; then
|
||||||
# Read the systemd journal
|
# Read the systemd journal
|
||||||
journalctl -u $service_name -f --since=-45 > "$templog" &
|
journalctl --unit=$service_name --follow --since=-0 --quiet > "$templog" &
|
||||||
else
|
else
|
||||||
# Read the specified log file
|
# Read the specified log file
|
||||||
tail -F -n0 "$log_path" > "$templog" &
|
tail -F -n0 "$log_path" > "$templog" &
|
||||||
fi
|
fi
|
||||||
# Get the PID of the tail command
|
# Get the PID of the tail command
|
||||||
local pid_tail=$!
|
local pid_tail=$!
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${action^} the service $service_name" >&2
|
echo "${action^} the service $service_name" >&2
|
||||||
systemctl $action $service_name \
|
systemctl $action $service_name \
|
||||||
|| ( journalctl --lines=$length -u $service_name >&2 \
|
|| ( journalctl --lines=$length -u $service_name --no-pager >&2 \
|
||||||
; test -n "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 \
|
; test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 \
|
||||||
; false )
|
; false )
|
||||||
|
|
||||||
# Start the timeout and try to find line_match
|
# Start the timeout and try to find line_match
|
||||||
|
@ -70,8 +70,8 @@ ynh_systemd_action() {
|
||||||
then
|
then
|
||||||
echo "The service $service_name didn't fully started before the timeout." >&2
|
echo "The service $service_name didn't fully started before the timeout." >&2
|
||||||
echo "Please find here an extract of the end of the log of the service $service_name:"
|
echo "Please find here an extract of the end of the log of the service $service_name:"
|
||||||
journalctl --lines=$length -u $service_name >&2
|
journalctl --lines=$length -u $service_name --no-pager >&2
|
||||||
test -n "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2
|
test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue