amit_g
asked on
How to restart cron on Sun OS 5.10
How to restart cron on Sun OS 5.10 without restarting the server? The system administrator used
/etc/cron restart
and killed the FIFO file. I believe now it is running two cron daemons as the log show each scheduled script being run twice. ps -f grep cron shows
root 6147 1 0 Dec 29 ? 0:01 /usr/sbin/cron
root 7377 1 0 Dec 29 ? 0:01 /etc/cron restart
The log file example
> CMD: /somedir/subdir/script1>/d ev/null 2>&1
> root 24236 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script2>/d ev/null 2>&1
> root 24237 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script3>/d ev/null 2>&1
> root 24240 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script1>/d ev/null 2>&1
> root 24258 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script2>/d ev/null 2>&1
> root 24259 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script3>/d ev/null 2>&1
> root 24266 c Tue Jan 5 04:00:01 2010
The uname -a returns
SunOS ServerName 5.10 Generic sun4u sparc SUNW,Sun-Fire-V240
ls -l /etc/init.d/cron returns
/etc/init.d/cron: No such file or directory
/etc/cron restart
and killed the FIFO file. I believe now it is running two cron daemons as the log show each scheduled script being run twice. ps -f grep cron shows
root 6147 1 0 Dec 29 ? 0:01 /usr/sbin/cron
root 7377 1 0 Dec 29 ? 0:01 /etc/cron restart
The log file example
> CMD: /somedir/subdir/script1>/d
> root 24236 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script2>/d
> root 24237 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script3>/d
> root 24240 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script1>/d
> root 24258 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script2>/d
> root 24259 c Tue Jan 5 04:00:00 2010
> CMD: /somedir/subdir/script3>/d
> root 24266 c Tue Jan 5 04:00:01 2010
The uname -a returns
SunOS ServerName 5.10 Generic sun4u sparc SUNW,Sun-Fire-V240
ls -l /etc/init.d/cron returns
/etc/init.d/cron: No such file or directory
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nevermind, should have read svsc man before posting :)
Yup, the 'svc:/system/cron:default' is the full FMRI (fault management resource identifier).
The following abbreviated version should also work:
svcadm restart cron
The following abbreviated version should also work:
svcadm restart cron
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
svcadm restart -t system/cron:default
ASKER
Worked like a charm. For the duplicate cron, the processes were killed using kill. Thanks everyone.
ASKER