Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.