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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${action^} the service $service_name" >&2
|
ynh_print_info --message="${action^} the service $service_name"
|
||||||
systemctl $action $service_name \
|
systemctl $action $service_name \
|
||||||
|| ( journalctl --no-pager --lines=$length -u $service_name >&2 \
|
|| ( 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 )
|
; false )
|
||||||
|
|
||||||
# Start the timeout and try to find line_match
|
# 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
|
# 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"
|
if grep --quiet "$line_match" "$templog"
|
||||||
then
|
then
|
||||||
echo "The service $service_name has correctly started." >&2
|
ynh_print_info --message="The service $service_name has correctly started."
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo -n "." >&2
|
echo -n "." >&2
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
echo "" >&2
|
||||||
if [ $i -eq $timeout ]
|
if [ $i -eq $timeout ]
|
||||||
then
|
then
|
||||||
echo "The service $service_name didn't fully started before the timeout." >&2
|
ynh_print_warn --message="The service $service_name didn't fully started before the timeout."
|
||||||
echo "Please find here an extract of the end of the log of the service $service_name:"
|
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
|
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
|
fi
|
||||||
|
|
||||||
echo ""
|
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue