Page MenuHomeDevCentral

/usr/local/etc/rc.d/netbox

Authored By
dereckson
Jun 11 2023, 11:12
Size
850 B
Referenced Files
None
Subscribers
None

/usr/local/etc/rc.d/netbox

#!/bin/sh
# PROVIDE: netbox
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# netbox_enable (bool): Set it to YES to enable netbox.
# Default is "NO".
# netbox_user (user): Set user to run netbox.
# Default is "netbox".
# netbox_port (int): Set port to run netbox.
# Default is "17000".
. /etc/rc.subr
name=netbox
rcvar=netbox_enable
load_rc_config $name
: ${netbox_enable:="NO"}
: ${netbox_user:="netbox"}
: ${netbox_port:="17000"}
pidfile=/var/run/netbox.pid
procname="/srv/netbox/netbox-3.4.4/service.sh"
command="/usr/sbin/daemon"
command_args="-f -t ${name} -p ${pidfile} /usr/bin/env APP_PORT=${netbox_port} ${procname}"
netbox_precmd()
{
touch ${pidfile}
chown ${netbox_user} ${pidfile}
}
start_precmd=${name}_precmd
run_rc_command "$1"

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1410808
Default Alt Text
/usr/local/etc/rc.d/netbox (850 B)

Event Timeline