--- /root/cron.conf.orig 2014-05-20 13:01:46.728302430 +0200 +++ /etc/init/cron.conf 2014-05-20 13:58:00.176604355 +0200 @@ -8,7 +8,26 @@ description "regular background program start on runlevel [2345] stop on runlevel [!2345] -expect fork respawn -exec cron +pre-start script + # su ensures that pam.d stuff like /etc/default/locale is loaded, + # but because we now have more forks than 2 (su forks twice, cron + # forks once), we cannot use the expect stanza anymore. + su - root -c cron +end script + +script + infinite_sleep() { + while pidof $1 >/dev/null; do + sleep 10 + done + } + infinite_sleep cron +end script + +post-stop script + if pidof cron >/dev/null; then + pkill cron + fi +end script