You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.5 KiB

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: openerp-server
  4. # Required-Start: $remote_fs $syslog
  5. # Required-Stop: $remote_fs $syslog
  6. # Should-Start: $network
  7. # Should-Stop: $network
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Enterprise Resource Management software
  11. # Description: Open ERP is a complete ERP and CRM software.
  12. ### END INIT INFO
  13. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  14. PYTHON=/srv/virtualenv/default/bin/python
  15. DAEMON=/opt/apps/openobject-server/openerp-server
  16. NAME=openerp-server
  17. DESC=openerp-server
  18. USER=openerp
  19. test -x ${DAEMON} || exit 0
  20. set -e
  21. case "${1}" in
  22. start)
  23. echo -n "Starting ${DESC}: "
  24. start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
  25. --chuid ${USER} --background --make-pidfile \
  26. --exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \
  27. --logfile=/var/log/openerp/openerp-server.log
  28. echo "${NAME}."
  29. ;;
  30. stop)
  31. echo -n "Stopping ${DESC}: "
  32. start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \
  33. --oknodo
  34. echo "${NAME}."
  35. ;;
  36. restart|force-reload)
  37. echo -n "Restarting ${DESC}: "
  38. start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \
  39. --oknodo
  40. sleep 1
  41. start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
  42. --chuid ${USER} --background --make-pidfile \
  43. --exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \
  44. --logfile=/var/log/openerp/openerp-server.log
  45. echo "${NAME}."
  46. ;;
  47. *)
  48. N=/etc/init.d/${NAME}
  49. echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
  50. exit 1
  51. ;;
  52. esac
  53. exit 0