source: hybrid/branches/releng-9.0/nanobsd/files/etc/rc.subr-nanobsd.patch@ 10694

Last change on this file since 10694 was 10648, checked in by rick, 13 years ago

Gebruik een patch om te zorgen dat het _echt_ stuk gaat tijdens bouwen als
/etc/rc.subr veranderd, anders start je nieuwe systeem helemaal niet op en zoek
je je een ongeluk waarom niet.

Related-To: nodefactory#129

File size: 1.4 KB
RevLine 
[10648]1#
2# Add ${name}_setfib functionality to rc.subr
3#
4--- rc.subr.orig 2012-01-03 08:26:59.000000000 +0100
5+++ rc.subr 2012-05-02 23:16:44.000000000 +0200
6@@ -499,6 +499,10 @@
7 #
8 # ${name}_nice n Nice level to run ${command} at.
9 #
10+# ${name}_setfib n Routing table for ${command} to use. Requires
11+# kernel with options ROUTETABLES=<nr> compiled.
12+#
13+#
14 # ${name}_user n User to run ${command} as, using su(1) if not
15 # using ${name}_chroot.
16 # Requires /usr to be mounted.
17@@ -675,7 +679,8 @@
18 fi
19 eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \
20 _nice=\$${name}_nice _user=\$${name}_user \
21- _group=\$${name}_group _groups=\$${name}_groups
22+ _group=\$${name}_group _groups=\$${name}_groups \
23+ _setfib=\$${name}_setfib
24
25 if [ -n "$_user" ]; then # unset $_user if running as that user
26 if [ "$_user" = "$(eval $IDCMD)" ]; then
27@@ -755,6 +760,7 @@
28 check_startmsgs && echo "Starting ${name}."
29 if [ -n "$_chroot" ]; then
30 _doit="\
31+${_setfib:+setfib -F $_setfib }\
32 ${_nice:+nice -n $_nice }\
33 chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
34 $_chroot $command $rc_flags $command_args"
35@@ -771,6 +777,9 @@
36 fi
37 _doit="nice -n $_nice $_doit"
38 fi
39+ if [ -n "$_setfib" ]; then
40+ _doit="setfib -F $_setfib $_doit"
41+ fi
42 fi
43
44 # run the full command
Note: See TracBrowser for help on using the repository browser.