Shane Castle
unread,Aug 30, 2016, 8:36:05 AM8/30/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to securit...@googlegroups.com
If rule-update is run manually and not through the cron job, the file
/var/log/nsm/pulledpork.log will not be updated with the results of the run.
Here is the line from /etc/cron.d/rule-update:
01 7 * * * root date >> /var/log/nsm/pulledpork.log ;
/usr/bin/rule-update cron >> /var/log/nsm/pulledpork.log 2>&1
As a result, when I want to run rule-update manually, I will "sudo -i" to get a
root command line and then run the command portion of the cron job entry, less
the 'cron' parameter:
date >> /var/log/nsm/pulledpork.log ; /usr/bin/rule-update >>
/var/log/nsm/pulledpork.log 2>&1
Question: should rule-update be changed so that it always updates the log file?
This would probably require a wrapper around a renamed script, probably using
tee as well:
date >> /var/log/nsm/pulledpork.log
/usr/bin/rule-update 2>&1 | tee -a /var/log/nsm/pulledpork.log
Making rule-update run 'date' first could eliminate the first line.
Where this becomes an issue is when the output of sostat is relied on to tell
the truth about the last run of rule-update, when in fact it will do so only if
it was run by cron or by the method mentioned above. The sostat-quick script,
for instance, believes this.
--
Mit besten Grüßen
Shane Castle