Bug 21250 - Periodic scripts that are 'disabled' have non-zero return code.
Summary: Periodic scripts that are 'disabled' have non-zero return code.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brian Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-09-13 14:20 UTC by jbarkley
Modified: 2000-09-14 19:14 UTC (History)
0 users

See Also:


Attachments
file.diff (6.09 KB, patch)
2000-09-13 14:20 UTC, jbarkley
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jbarkley 2000-09-13 14:20:00 UTC
We have tweaked the main periodic script so that it only sends mail
upon the detection of an error condition.  Error conditions are
generally defined by the subscript placing the string **ERROR** in its
output.  Additionally we check for writes to stderr and the return code
of the subscripts.

The latest update to the periodic subscripts utilize an case command
to determine if they are to be executed or not.  Unfortunatley there
is only one pattern given.  When the case command is unable to match
any pattern it sets a return code of 1.  As this is the last command
executed in the subscript this return code is sent back to the periodic
script

Fix: The following can be used to patch the daily scripts with a default 
pattern:
How-To-Repeat: Modify periodic (in /usr/sbin) to report the subscript and its return
code.  Notice that 'disabled' subscript have a return code of 1 and 
'enabled' subscripts have a return code of 0.
Comment 1 Brian Somers freebsd_committer freebsd_triage 2000-09-13 20:25:47 UTC
Responsible Changed
From-To: freebsd-bugs->brian

I'll deal with this.  I'm going to take this a bit further - an exit of 0 
means everything's ok and nothing of note needs to be reported.  An exit 
of 1 means something of interest happened.  An exit of >1 means that 
an error occurred. 

Periodic(8) will be able to either mail or log it's output and can be told 
to report everything, everything of interest or errors only.
Comment 2 Brian Somers freebsd_committer freebsd_triage 2000-09-14 19:13:25 UTC
State Changed
From-To: open->closed

All periodic scripts now have specific return code requirements in -current