Restart Solaris 10 SMF service automatically each day

0

I am currently facing the problem how to restart a SMF service automatically each day at a specific time. The simplest solution probably is to use cron. Currently my main objection is handling "lost events": the solution must work in case of failure as well, so it must restart the service later the same day if the computer wasn't running at the scheduled time. Unfortunately anacron is not available on that machine, so I cannot use that. With this I am stuck with using more than one crontab entry to check if a scheduled event was missed. Is there an easier way to implement this?

Magnus Müller

Posted 2012-01-16T15:07:38.767

Reputation: 1

Answers

0

I will settle with a simple cron job for this task. The combination cron+smf should be sufficient: SMF takes care of keeping the service running and restarts it in case of failure. Cron restarts the service periodically. If cronjob doesn't restart the service, which AFAIK should only happen if the machine was restarted during the time the service should have been started, then SMF will start the service itself again, as the service must be offline as well. I doubt that there are occusions were cronjob will fail and the service is still running. If this could be the case, then SMF would not restart the service by itself, but hopefully this won't happen.

Magnus Müller

Posted 2012-01-16T15:07:38.767

Reputation: 1