Over in opensolaris-discuss, as an addition to a response to a question about 
sar data
file retention, I went off about something else I noticed that's more SMF 
related
(at least with respect to how the manifest for the service was written).  So 
I'll put it
here too, hoping someone will take a look at this.  I'm pretty sure I can think 
of cases
where the described behavior could cause problems...

Looking at the method script for the sar service (as of snv_97), I see that
it creates the sys crontab file if it doesn't exist (for start) or deletes it 
unconditionally
(for stop), directly, without using the crontab command. That might not work 
well if
someone enabled the service when cron was already running (although if the file 
was
created with the proper permissions, it might be ok if svc:/system/sar:default 
started
before cron); once cron is running, it needs to be notified of changes to its 
files. Further,
simply deleting the file is obnoxious insofar as it makes it a problem
if someone wants to edit the sys crontab file, since their edits will be lost 
if the
service is restarted (or on next boot).

Ideally (IMO), the method script would check if cron (in the same zone) was 
running
and choose accordingly between using crontab command (if it was) or directly 
modifying
the files (if the service starts before cron). And if it's going to fool with 
that crontab
at all, it should either do so more smartly (commenting out or un-commenting, 
but
not simply deleting the crontab), or just leave it alone (people used to have 
to do
that by hand, after all). Certainly if the service _does_ modify the crontab 
file,
sar(1m) should say something about the scope of the changes to the sys crontab 
made
by the svc:/system/sar:default service.

Just because the current arrangement is more or less reasonable _if_
svc:/system/sar:default was enabled at boot _and_ nobody ever puts anything in
the sys crontab (or even changes the collection intervals) doesn't make it 
reasonable
outside of those limits. Personally, I think if I wanted it to maintain those 
lines, I'd
have a template file separate from the method script that in SVR4 pkg terms was
editable, so that it would survive package updates, and that had a comment on 
the
end of the lines it supplied so they could easily be removed from the sys 
crontab
without affecting other lines.
-- 
This message posted from opensolaris.org

Reply via email to