-
-
Save sistematico/5cdd355bcf8ef338929d1a8573db5a61 to your computer and use it in GitHub Desktop.
FreeBSD service script for Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: nodejs | |
# REQUIRE: NETWORKING SERVERS DAEMON | |
# BEFORE: LOGIN | |
# File: /etc/rc.d/nodejs | |
# https://docs.freebsd.org/en/articles/rc-scripting | |
# https://man.freebsd.org/cgi/man.cgi?query=daemon | |
# https://forums.freebsd.org/threads/beep-on-sucessful-bootup.64145/#post-394617 | |
. /etc/rc.subr | |
name="nodejs" | |
rcvar=${name}_enable | |
entrypoint="/www/testserver/start.js" | |
pidfile="/var/run/testserver.pid" | |
command="/usr/sbin/daemon" | |
command_args="-r -f -u www -t 'Testserver Daemon' -P ${pidfile} -o /www/testserver/daemon.log -r /usr/local/bin/node ${entrypoint}" | |
#command_args="-P ${pidfile} -R 10 -f -u ${overseerr_user} ${overseerr_command} ${overseerr_args}" | |
load_rc_config $name | |
: ${nodejs_enable:=no} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment