mcserv.init 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #! /bin/sh
  2. #
  3. # skeleton Example file to build /etc/init.d scripts.
  4. #
  5. # Version: @(#) /etc/init.d/mcserv 07/10/2000
  6. #
  7. # Author: Tomasz K³oczko, <kloczek@rudy.mif.pg.gda.pl>
  8. # Michele Marziani <marziani@fe.infn.it>
  9. # Preston Brown <pbrown@redhat.com>
  10. #
  11. # chkconfig: - 86 30
  12. # description: The Midnight Commander server allows users on remote machines \
  13. # to use the Midnight Commander file manager to manipulate their \
  14. # files on the machine running the server. The server \
  15. # authenticates the user through PAM, which by default requires \
  16. # a username/password combination before allowing access.
  17. # processname: mcserv
  18. # Source function library.
  19. . /etc/init.d/functions
  20. RETVAL=0
  21. prog="mcserv"
  22. start() {
  23. echo -n $"Starting $prog: "
  24. daemon /usr/bin/mcserv -d
  25. RETVAL=$?
  26. touch /var/lock/subsys/mcserv
  27. echo
  28. }
  29. stop() {
  30. echo -n $"Stopping $prog: "
  31. killproc mcserv
  32. RETVAL=$?
  33. rm -f /var/lock/subsys/mcserv
  34. echo
  35. }
  36. # See how we were called.
  37. case "$1" in
  38. start)
  39. start
  40. ;;
  41. status)
  42. status mcserv
  43. ;;
  44. restart|reload)
  45. stop
  46. start
  47. ;;
  48. condrestart)
  49. if [ -f /var/lock/subsys/mcserv ]; then
  50. stop
  51. start
  52. fi
  53. ;;
  54. stop)
  55. stop
  56. ;;
  57. *)
  58. echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
  59. exit 1
  60. esac
  61. exit $RETVAL