mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Use printers
This commit is contained in:
parent
f51101152a
commit
12c61eeb65
1 changed files with 7 additions and 8 deletions
|
@ -106,10 +106,10 @@ ynh_systemd_action() {
|
|||
fi
|
||||
fi
|
||||
|
||||
echo "${action^} the service $service_name" >&2
|
||||
ynh_print_info --message="${action^} the service $service_name"
|
||||
systemctl $action $service_name \
|
||||
|| ( journalctl --no-pager --lines=$length -u $service_name >&2 \
|
||||
; test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 \
|
||||
; test -e "$log_path" && echo "--" >&2 && tail --lines=$length "$log_path" >&2 \
|
||||
; false )
|
||||
|
||||
# Start the timeout and try to find line_match
|
||||
|
@ -121,21 +121,20 @@ ynh_systemd_action() {
|
|||
# Read the log until the sentence is found, that means the app finished to start. Or run until the timeout
|
||||
if grep --quiet "$line_match" "$templog"
|
||||
then
|
||||
echo "The service $service_name has correctly started." >&2
|
||||
ynh_print_info --message="The service $service_name has correctly started."
|
||||
break
|
||||
fi
|
||||
echo -n "." >&2
|
||||
sleep 1
|
||||
done
|
||||
echo "" >&2
|
||||
if [ $i -eq $timeout ]
|
||||
then
|
||||
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:"
|
||||
ynh_print_warn --message="The service $service_name didn't fully started before the timeout."
|
||||
ynh_print_warn --message="Please find here an extract of the end of the log of the service $service_name:"
|
||||
journalctl --no-pager --lines=$length -u $service_name >&2
|
||||
test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2
|
||||
test -e "$log_path" && echo "--" >&2 && tail --lines=$length "$log_path" >&2
|
||||
fi
|
||||
|
||||
echo ""
|
||||
ynh_clean_check_starting
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue