mirror of
https://git.freebsd.org/ports.git
synced 2025-06-12 00:00:33 -04:00
- Add svclone script for creating copies of services, adding/updating supervise symlinks, etc. - Stop resetting the current runlevel to the default on every update - When /var/service already exists on the system make sure to try and update it on install and not just create a symlink under it - With ROOT=on be more conservative with what's installed into /sbin, just enough to bootstrap the system until /usr/local is mounted
40 lines
896 B
Bash
40 lines
896 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: runsvdir
|
|
# BEFORE: SERVERS
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable `runsvdir':
|
|
#
|
|
# runsvdir_enable="YES"
|
|
# runsvdir_path="/var/service"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=runsvdir
|
|
desc="starts and monitors a collection of runsv(8) processes"
|
|
rcvar=runsvdir_enable
|
|
|
|
load_rc_config runsvdir
|
|
|
|
: ${runsvdir_enable:=NO}
|
|
: ${runsvdir_path=/var/service}
|
|
|
|
command="%%PREFIX%%/sbin/runsvdir"
|
|
start_cmd=runsvdir_start
|
|
stop_postcmd="%%PREFIX%%/sbin/sv exit ${runsvdir_path}/*"
|
|
|
|
runsvdir_start()
|
|
{
|
|
/bin/mkdir -p /var/run/runit/runsvdir
|
|
/bin/ln -sF %%RUNITDIR%%/runsvdir/current /var/run/runit/runsvdir/current
|
|
/bin/test -d ${runsvdir_path} || /bin/mkdir -p ${runsvdir_path}
|
|
/usr/bin/env -i \
|
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%PREFIX%%/bin:%%PREFIX%%/sbin:/rescue \
|
|
/usr/sbin/daemon -c -f \
|
|
${command} ${runsvdir_path}
|
|
}
|
|
|
|
run_rc_command $1
|