Link to home
Start Free TrialLog in
Avatar of amit_g
amit_gFlag for United States of America

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>/dev/null 2>&1
>  root 24236 c Tue Jan  5 04:00:00 2010
>  CMD: /somedir/subdir/script2>/dev/null 2>&1
>  root 24237 c Tue Jan  5 04:00:00 2010
>  CMD: /somedir/subdir/script3>/dev/null 2>&1
>  root 24240 c Tue Jan  5 04:00:00 2010
>  CMD: /somedir/subdir/script1>/dev/null 2>&1
>  root 24258 c Tue Jan  5 04:00:00 2010
>  CMD: /somedir/subdir/script2>/dev/null 2>&1
>  root 24259 c Tue Jan  5 04:00:00 2010
>  CMD: /somedir/subdir/script3>/dev/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
ASKER CERTIFIED SOLUTION
Avatar of larsrohr
larsrohr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amit_g

ASKER

What is /system/cron? There is no cron in /system.
Avatar of amit_g

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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
svcadm restart -t system/cron:default
Avatar of amit_g

ASKER

Worked like a charm. For the duplicate cron, the processes were killed using kill. Thanks everyone.