Интересное

Сообщение об ошибке

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 684 of /home/www/nixtalk.com/includes/bootstrap.inc).

Init скрипт запуска Netams4

Опубликовано вт, 12/03/2013 - 11:37 пользователем Demontager

Позволяет добавить Netams4 в стандартную службу init

  1. #!/bin/sh
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides: netams4
  5. # Required-Start: $local_fs $network
  6. # Required-Stop: $local_fs $network
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: starts netams4 services
  10. # Description: starts netams4 using start-stop-daemon
  11. ### END INIT INFO
  12.  
  13. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  14. NPATH=/usr/local/netams4
  15.  
  16. start() {
  17. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  18. if [ -z "$PIDS" ]; then
  19. cd $NPATH/jserver && sh jserver-startup.sh && cd $NPATH/webadmin && sh webadmin-startup.sh && cd $NPATH/repserver && sh repserver-startup.sh
  20. local CHECK=`echo $?`
  21. if [ $CHECK = 0 ]; then
  22. echo "Netams4 successfully started"
  23. else
  24. echo "Error starting Netams4"
  25. fi
  26. else
  27. echo "Netams4 already running"
  28. fi
  29. }
  30.  
  31.  
  32. stop() {
  33. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  34. if [ -n "$PID" ]; then
  35. for i in $PID
  36. do kill $i
  37. done
  38. local array=( $PID )
  39. echo "Netams4 processes stopped: ${array[@]}"
  40. else
  41. echo "Netams4 not running"
  42. fi
  43. }
  44.  
  45. status() {
  46. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  47. local array=( $PID )
  48. if [ -n "$PID" ]; then
  49. echo "Netams running: ${array[@]}"
  50. cat << EOF
  51.  
  52. User:
  53. http://localhost:8080
  54.  
  55. Admin:
  56. http://localhost:8080/webadmin/webadmin.html
  57. EOF
  58. else
  59. echo "Netams4 not running"
  60. fi
  61. }
  62.  
  63. case "$1" in
  64. start)
  65. start
  66. ;;
  67. stop)
  68. stop
  69. ;;
  70. restart)
  71. stop
  72. sleep 2
  73. start
  74. ;;
  75. status)
  76. status
  77. ;;
  78. *)
  79. echo "Usage: `basename $0` (start|stop|restart|status)"
  80. exit 1
  81. ;;
  82. esac
Поделится: 

Добавить комментарий