moonraker.initd 761 B

123456789101112131415161718192021222324252627282930
  1. #!/sbin/openrc-run
  2. # Copyright 2022 Gentoo Authors
  3. # Distributed under the terms of the GNU General Public License v2
  4. name="Moonraker daemon"
  5. description="Moonraker Klipper HTTP Server"
  6. pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
  7. user=${user:-klipper}
  8. group=${group:-klipper}
  9. command="/opt/${RC_SVCNAME}/${RC_SVCNAME}.py"
  10. command_args="${command_args:--c /etc/klipper/${RC_SVCNAME}.conf}"
  11. command_background="true"
  12. start_pre() {
  13. # We need to test if /run/klipper exists, since script will fail if it does not
  14. checkpath -q -d "/run/${RC_SVCNAME}"
  15. }
  16. depend()
  17. {
  18. need localmount
  19. after net
  20. }
  21. start_stop_daemon_args="--user ${user} --group ${group} \
  22. --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
  23. --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"