mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
Add rc.d script
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
bin/sysadm
|
||||
bin/sysadm-server
|
||||
etc/rc.d/sysadm
|
||||
include/sysadm-general.h
|
||||
include/sysadm-global.h
|
||||
include/sysadm-lifepreserver.h
|
||||
|
||||
41
src/rc.d/pcbsd-sysadm
Executable file
41
src/rc.d/pcbsd-sysadm
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# PROVIDE: sysadm
|
||||
# REQUIRE: LOGIN cleanvar
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable sysadm:
|
||||
# sysadm_enable (bool): Set to "NO" by default.
|
||||
# Set it to "YES" to enable sysadm
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="sysadm"
|
||||
rcvar=sysadm_enable
|
||||
|
||||
command="/usr/local/bin/syscache-server"
|
||||
start_cmd="sysadm_start"
|
||||
stop_cmd="sysadm_stop"
|
||||
|
||||
[ -z "$sysadm_enable" ] && sysadm_enable="NO"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
sysadm_stop()
|
||||
{
|
||||
if [ -e "/var/run/sysadm.pid" ] ; then
|
||||
pkill -9 -F /var/run/sysadm.pid
|
||||
fi
|
||||
}
|
||||
|
||||
sysadm_start()
|
||||
{
|
||||
export PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
|
||||
sysadm_stop
|
||||
echo "Starting sysadm..."
|
||||
daemon -p /var/run/sysadm.pid $command $flags >/dev/null 2>/dev/null
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
@@ -7,3 +7,7 @@ SUBDIRS+= library binary server
|
||||
binary.depends = library
|
||||
server.depends = library
|
||||
|
||||
rcd.path = /usr/local/etc/rc.d/
|
||||
rcd.extra = cp rc.d/* $(INSTALL_ROOT)/usr/local/etc/rc.d/
|
||||
|
||||
INSTALLS += rcd
|
||||
|
||||
Reference in New Issue
Block a user