From 87fb703e5b07800990d7e1a6cc225c6ffef2470d Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 11 Apr 2024 11:02:24 -0400 Subject: [PATCH] kandra: Log and timestamp autossh output. By default, autossh writes to syslog; setting AUTOSSH_DEBUG is the only way to produce output to STDERR. Timestamp that and log that to the logfile, making the logs perhaps useful. --- .../templates/supervisor/conf.d/autossh_tunnels.conf.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/puppet/kandra/templates/supervisor/conf.d/autossh_tunnels.conf.erb b/puppet/kandra/templates/supervisor/conf.d/autossh_tunnels.conf.erb index 5e2aa1045f..5d4f0bc82b 100644 --- a/puppet/kandra/templates/supervisor/conf.d/autossh_tunnels.conf.erb +++ b/puppet/kandra/templates/supervisor/conf.d/autossh_tunnels.conf.erb @@ -5,12 +5,14 @@ i = 0 @hosts.each do |host| -%> [program:autossh-tunnel-<%= host %>] -command=autossh -N -M <%= 20000 + 2 * i %> -o ControlMaster=yes nagios@<%= host %><% unless host.include?(".") %>.<%= @default_host_domain %><% end %> +environment=AUTOSSH_DEBUG=1 +command=bash -c 'exec autossh -N -M <%= 20000 + 2 * i %> -o ControlMaster=yes nagios@<%= host %><% unless host.include?(".") %>.<%= @default_host_domain %><% end %> 2>&1 | ts "%%b %%d %%H:%%M:%%.S"' priority=200 ; the relative start priority (default 999) autostart=true ; start at supervisord start (default: true) autorestart=true ; whether/when to restart (default: unexpected) stopsignal=TERM ; signal used to kill process (default TERM) stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) +stopasgroup=true user=nagios ; setuid to this UNIX account to run the program redirect_stderr=true ; redirect proc stderr to stdout (default false) stdout_logfile=/var/log/zulip/autossh.<%= host %>.log ; stdout log path, NONE for none; default AUTO