root/trunk/freewrt/package/busybox/files/crond.init

Revision 3512, 376 bytes (checked in by tg, 5 years ago)

fix the problem that a “/etc/init.d/ntpd restart” wouldn’t work
because it uses “killall ntpd” and nukes itself: on execution,
run mksh(1) with ourselves first, to make sure that killall/pkill
will see our process name as “mksh” instead of e.g. “…/ntpd”.

Line 
1 #!/bin/sh
2 test x"$1" = x"really" || exec /bin/mksh "$0" really "$@"
3 shift
4 #FWINIT 60
5 . /etc/rc.conf
6
7 case $1 in
8 autostop) ;;
9 autostart)
10         test x"${crond:-NO}" = x"NO" && exit 0
11         exec sh $0 start
12         ;;
13 start)
14         mkdir -p /var/spool/cron
15         crond
16         ;;
17 stop)
18         killall crond
19         ;;
20 restart)
21         sh $0 stop
22         sh $0 start
23         ;;
24 *)
25         echo "Usage: $0 {start | stop | restart}"
26         exit 1
27         ;;
28 esac
29 exit $?
Note: See TracBrowser for help on using the browser.