servis 849 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. #
  3. # /etc/init.d/fcron: start/stop fcron daemon
  4. #
  5. SSD=/sbin/start-stop-daemon
  6. PROG=/usr/sbin/fcron
  7. PID=/var/run/fcron.pid
  8. OPTS="--background"
  9. case $1 in
  10. start)
  11. $SSD --start --pidfile $PID --exec $PROG -- $OPTS
  12. RETVAL=$?
  13. if [ $RETVAL -eq 0 -a ! -f /var/spool/fcron/systab ]; then
  14. /usr/bin/fcrontab -u systab -z
  15. fi
  16. ;;
  17. stop)
  18. $SSD --stop --retry 10 --pidfile $PID
  19. RETVAL=$?
  20. ;;
  21. restart)
  22. $0 stop
  23. $0 start
  24. ;;
  25. reload)
  26. $SSD --stop --signal USR1 --pidfile $PID
  27. RETVAL=$?
  28. ;;
  29. status)
  30. $SSD --status --pidfile $PID
  31. case $? in
  32. 0) echo "$PROG is running with pid $(cat $PID)" ;;
  33. 1) echo "$PROG is not running but the pid file $PID exists" ;;
  34. 3) echo "$PROG is not running" ;;
  35. 4) echo "Unable to determine the program status" ;;
  36. esac
  37. ;;
  38. *)
  39. echo "usage: $0 [start|stop|restart|reload|status]"
  40. ;;
  41. esac
  42. exit $RETVAL
  43. # End of file