Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

snf-server.freebsd 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. #
  3. # SNFServer This shell script takes care of starting and stopping
  4. # the ARM Research SNFServer daemon for FreeBSD systems.
  5. #
  6. # Author-- Alban Deniz
  7. #
  8. # Copyright (C) 2008 ARM Research Labs, LLC.
  9. # See www.armresearch.com for the copyright terms.
  10. #
  11. # PROVIDE: SNFServer
  12. # REQUIRE: FILESYSTEMS
  13. # KEYWORD: shutdown
  14. . /etc/rc.subr
  15. # Location of programs.
  16. installedDir="PREFIX"
  17. # Location of programs.
  18. dir="$installedDir/sbin"
  19. # Name of config file.
  20. configFile="CONFFILE"
  21. # Name of daemon.
  22. prog="SNFServer"
  23. # Name of client.
  24. clientProg="SNFClient"
  25. name="snfserver"
  26. rcvar=`set_rcvar`
  27. command=$dir/$prog
  28. command_args="$configFile > /dev/null 2>&1 &"
  29. required_dirs=$dir
  30. required_files="$dir/$prog $dir/$clientProg $configFile"
  31. snf_user=snfilter
  32. snf_group=snfilter
  33. start_postcmd="${name}_poststart"
  34. snfserver_poststart()
  35. {
  36. $dir/$clientProg -status.second > /dev/null 2>&1
  37. return $?
  38. }
  39. stop_cmd="${name}_stop"
  40. snfserver_stop()
  41. {
  42. echo "Stopping $name."
  43. $dir/$clientProg -shutdown > /dev/null 2>&1
  44. sleep 10
  45. }
  46. stop_postcmd="${name}_poststop"
  47. snfserver_poststop()
  48. {
  49. SNFPID=$(check_process $dir/$prog)
  50. if [ -n "$SNFPID" ]; then
  51. kill $SNFPID
  52. RETVAL=$?
  53. else
  54. RETVAL=0
  55. fi
  56. return $RETVAL
  57. }
  58. load_rc_config $name
  59. run_rc_command "$1"