sysrqd.init 700 B

1234567891011121314151617181920212223242526272829303132
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2007 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. need net
  6. }
  7. checkconfig() {
  8. sysrqd_secret=/etc/sysrqd/sysrqd.secret
  9. sysrqd_pidfile=/var/run/sysrqd.pid
  10. if [ ! -e ${sysrqd_secret} ]; then
  11. eerror "You need a '${sysrqd_secret}' containing a secret/password!"
  12. eerror "Refusing to start."
  13. return 1
  14. fi
  15. }
  16. start() {
  17. checkconfig || return 1
  18. ebegin "Starting ${SVCNAME}"
  19. start-stop-daemon --start --pidfile ${sysrqd_pidfile} --quiet --exec /usr/sbin/sysrqd
  20. eend $?
  21. }
  22. stop() {
  23. checkconfig || return 1
  24. ebegin "Stopping ${SVCNAME}"
  25. start-stop-daemon --stop --quiet --pidfile ${sysrqd_pidfile}
  26. eend $?
  27. }