Don't display the hostname when calling journalctl, this takes horizontal space for nothing

This commit is contained in:
Alexandre Aubin 2020-05-22 13:40:53 +02:00
parent 1f1b233839
commit 2bcfb5a15a
2 changed files with 3 additions and 3 deletions

View file

@ -134,7 +134,7 @@ EOF
ynh_systemd_action --service_name=fail2ban --action=reload --line_match="(Started|Reloaded) Fail2Ban Service" --log_path=systemd ynh_systemd_action --service_name=fail2ban --action=reload --line_match="(Started|Reloaded) Fail2Ban Service" --log_path=systemd
local fail2ban_error="$(journalctl --unit=fail2ban | tail --lines=50 | grep "WARNING.*$app.*")" local fail2ban_error="$(journalctl --no-hostname --unit=fail2ban | tail --lines=50 | grep "WARNING.*$app.*")"
if [[ -n "$fail2ban_error" ]] if [[ -n "$fail2ban_error" ]]
then then
ynh_print_err --message="Fail2ban failed to load the jail for $app" ynh_print_err --message="Fail2ban failed to load the jail for $app"

View file

@ -145,7 +145,7 @@ ynh_systemd_action() {
if ! systemctl $action $service_name if ! systemctl $action $service_name
then then
# Show syslog for this service # Show syslog for this service
ynh_exec_err journalctl --no-pager --lines=$length --unit=$service_name ynh_exec_err journalctl --no-hostname --no-pager --lines=$length --unit=$service_name
# If a log is specified for this service, show also the content of this log # If a log is specified for this service, show also the content of this log
if [ -e "$log_path" ] if [ -e "$log_path" ]
then then
@ -183,7 +183,7 @@ ynh_systemd_action() {
then then
ynh_print_warn --message="The service $service_name didn't fully executed the action ${action} before the timeout." ynh_print_warn --message="The service $service_name didn't fully executed the action ${action} before the timeout."
ynh_print_warn --message="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:"
ynh_exec_warn journalctl --no-pager --lines=$length --unit=$service_name ynh_exec_warn journalctl --no-hostname --no-pager --lines=$length --unit=$service_name
if [ -e "$log_path" ] if [ -e "$log_path" ]
then then
ynh_print_warn --message="\-\-\-" ynh_print_warn --message="\-\-\-"