uchiwa_freebsd.j2 585 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. . /etc/rc.subr
  3. name=uchiwa
  4. rcvar=uchiwa_enable
  5. command="{{ sensu_uchiwa_path }}/go/bin/${name}"
  6. uchiwa_flags="-d {{ sensu_uchiwa_path }} -c {{ sensu_uchiwa_path }}/etc/config.json -p {{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa/public"
  7. load_rc_config $name
  8. pidfile=/var/run/${name}.pid
  9. start_cmd=uchiwa_start
  10. stop_postcmd=uchiwa_cleanup
  11. uchiwa_start() {
  12. echo "Starting uchiwa."
  13. /usr/bin/touch ${pidfile}
  14. /usr/sbin/daemon -cf -p ${pidfile} ${command} ${uchiwa_flags}
  15. }
  16. uchiwa_cleanup() {
  17. [ -f ${pidfile} ] && /bin/rm ${pidfile}
  18. }
  19. run_rc_command "$1"