xsd.initrc 710 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/sbin/openrc-run
  2. SVCNAME=xsd
  3. XSD_PIDFILE=/var/run/xsd.pid
  4. XSD_USER=root
  5. XSD_HOME=/var/run
  6. INST_PREFIX=/usr/local
  7. COMMAND=$INST_PREFIX/sbin/xsd
  8. ARGS="-L"
  9. depend() {
  10. need net
  11. use dns logger
  12. }
  13. checkconfig() {
  14. if [ ! -f "$COMMAND" ] ; then
  15. eerror "$COMMAND not installed" || return 1
  16. fi
  17. return 0
  18. }
  19. start() {
  20. checkconfig || return 1
  21. ebegin "Starting ${SVCNAME}"
  22. start-stop-daemon \
  23. -d ${XSD_HOME} \
  24. --make-pidfile --pidfile ${XSD_PIDFILE} \
  25. --start --quiet --background \
  26. --exec "${COMMAND}" -- "${ARGS}"
  27. eend $?
  28. }
  29. stop() {
  30. ebegin "Stopping ${SVCNAME}"
  31. start-stop-daemon --stop --quiet --pidfile $XSD_PIDFILE
  32. eend $?
  33. }