[BlueOnyx:21723] Re: 5209R, fix_syslog.sh, lsof

Michael Stauber mstauber at blueonyx.it
Sat Feb 10 19:00:22 -05 2018


Hi Carl,

> /usr/sausalito/handlers/base/swupdate/yum-update.sh runs
> /usr/sausalito/sbin/fix_syslog.sh which contains
> 
> if [ `lsof -c rsyslogd | grep -c var.log` -eq 1 ]; then
> 
> apparently that runs without /sbin or /usr/sbin in the path, so lsof is
> not found. That should probably be:

It is found. The reason for not including the full path(s) for some
commands is that they are within the $PATH variable of swatch, which
includes /sbin and /usr/sbin as well.

You probably got the impression it wasn't in the path, as you didn't SSH
into the box as "root" or used "su" instead of "su -" to gain root
access. In which cases none of the "sbin" directories get added to your
path.

We omitted the path specifically here, because until recently we used
the exact same Swatch for 5107R, 5108R, 5207R, 5208R and 5209R. The
paths for certain binaries such as "lsof", "grep" and other are sadly
different between EL6 and EL7 for no apparent reason.

> Also, since this is on Centos 7 with systemctl, the service stop/start
> should probably be done with systemctl.

Indeed. The whole condition only fires if Systemd is present anyway, so
we can just go ahead and use "systemctl" instead of "service" there.

I just published an updated Swatch for 5209R. Thank you!

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list