morty.rc.j2 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # $FreeBSD: branches/2020Q1/www/morty/files/morty.in 463944 2018-03-09 08:34:57Z yuri $
  3. # PROVIDE: morty
  4. # REQUIRE: DAEMON NETWORKING
  5. # BEFORE: LOGIN
  6. # KEYWORD: shutdown
  7. # Add the following lines to /etc/rc.conf to enable morty:
  8. # morty_enable="YES"
  9. #
  10. # morty_enable (bool): Set to YES to enable morty
  11. # Default: NO
  12. # morty_conf (str): morty configuration file
  13. # Default: ${PREFIX}/etc/morty.conf
  14. # morty_user (str): morty daemon user
  15. # Default: morty
  16. # morty_group (str): morty daemon group
  17. # Default: morty
  18. # morty_flags (str): Extra flags passed to morty
  19. . /etc/rc.subr
  20. name="morty"
  21. rcvar=morty_enable
  22. : ${morty_enable:="NO"}
  23. : ${morty_user:="www"}
  24. : ${morty_group:="www"}
  25. : ${morty_flags:=""}
  26. # daemon
  27. pidfile="/var/run/${name}.pid"
  28. command="/usr/local/bin/${name}"
  29. procname="morty"
  30. command_args=" -listen 0.0.0.0:3003 -key {{morty_secret_key}} &"
  31. start_precmd="morty_precmd"
  32. morty_precmd() {
  33. install -o ${morty_user} /dev/null ${pidfile}
  34. }
  35. load_rc_config $name
  36. run_rc_command "$1"