Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162829580
D7474.id19208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7474.id19208.diff
View Options
Index: etc/rc.subr
===================================================================
--- etc/rc.subr
+++ etc/rc.subr
@@ -746,6 +746,28 @@
# ${name}_chdir n Directory to cd to before running ${command}
# (if not using ${name}_chroot).
#
+# ${name}_daemon n Arguments to pass to daemon(8) before
+# running ${command}.
+#
+# ${name}_flags n Arguments to call ${command} with.
+# NOTE: $flags from the parent environment
+# can be used to override this.
+#
+# ${name}_env n Environment variables to run ${command} with.
+#
+# ${name}_fib n Routing table number to run ${command} with.
+#
+# ${name}_nice n Nice level to run ${command} at.
+#
+# ${name}_oomprotect n Don't kill ${command} when swap space is exhausted.
+#
+# ${name}_user n User to run ${command} as, using su(1) if not
+# using ${name}_chroot.
+# Requires /usr to be mounted.
+#
+# ${name}_group n Group to run chrooted ${command} as.
+# Requires /usr to be mounted.
+#
# ${name}_flags n Arguments to call ${command} with.
# NOTE: $flags from the parent environment
# can be used to override this.
@@ -949,6 +971,7 @@
fi
eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \
_nice=\$${name}_nice _user=\$${name}_user \
+ _daemon=\$${name}_daemon _daemon=\$${name}_daemon \
_group=\$${name}_group _groups=\$${name}_groups \
_fib=\$${name}_fib _env=\$${name}_env \
_prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} \
@@ -1044,19 +1067,22 @@
# setup the full command to run
#
check_startmsgs && echo "Starting ${name}."
+ _doit="$command $rc_flags $command_args"
+ if [ -n "$_daemon" ]; then
+ _doit="daemon $_daemon $_doit"
+ fi
if [ -n "$_chroot" ]; then
_doit="\
${_nice:+nice -n $_nice }\
${_fib:+setfib -F $_fib }\
${_env:+env $_env }\
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
-$_chroot $command $rc_flags $command_args"
+$_chroot $_doit"
else
_doit="\
${_chdir:+cd $_chdir && }\
${_fib:+setfib -F $_fib }\
-${_env:+env $_env }\
-$command $rc_flags $command_args"
+${_env:+env $_env } $_doit"
if [ -n "$_user" ]; then
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 18, 8:49 AM (13 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35193318
Default Alt Text
D7474.id19208.diff (2 KB)
Attached To
Mode
D7474: Add rc.conf support for foo_daemon="-r".
Attached
Detach File
Event Timeline
Log In to Comment