Forrest Aldrich
2011-01-14 22:32:44 UTC
I ran into an unfortunate problem with cron recently, where I had "assumed" that a HUP signal would cause it to re-read a new crontab entry. The result was a script was run that deleted some data.
Turns out, the code shows SIGHUP, SIG_IGN. I was not happy.
In any case, I want to understand the best way to manage this service. The manpage doesn't really specify what it responds to. So here we go...
The simplest way I can find is:
# /etc/init.d/cron stop (then start)
But this is Solaris, so we might use:
svcadm restart -t system/cron:default
but it's not clear whether "restart" or "refresh" will do the trick. "refresh" seems to be used to re-read the *service* configuration (xml), but does that cause it to re-read the crontabs?
Running crontab -e is not applicable to what I'm doing here. I experimented with it and it turns out you can't use that functionality in a scripted environment, it doesn't work. I have a script that edits a line of a crontab, either commented out or not. Then it needs to tell cron to re-read the tabs.
Pointers appreciated. Thanks.
Turns out, the code shows SIGHUP, SIG_IGN. I was not happy.
In any case, I want to understand the best way to manage this service. The manpage doesn't really specify what it responds to. So here we go...
The simplest way I can find is:
# /etc/init.d/cron stop (then start)
But this is Solaris, so we might use:
svcadm restart -t system/cron:default
but it's not clear whether "restart" or "refresh" will do the trick. "refresh" seems to be used to re-read the *service* configuration (xml), but does that cause it to re-read the crontabs?
Running crontab -e is not applicable to what I'm doing here. I experimented with it and it turns out you can't use that functionality in a scripted environment, it doesn't work. I have a script that edits a line of a crontab, either commented out or not. Then it needs to tell cron to re-read the tabs.
Pointers appreciated. Thanks.
--
This message posted from opensolaris.org
This message posted from opensolaris.org