rcNG cleanups...
Pawel Jakub Dawidek
pjd at FreeBSD.org
Thu Mar 4 14:40:06 PST 2004
Hi.
While choosing scripts that are not usable inside jail, I've found few
things that should be solved.
1. There are many scripts from NetBSD that are not instaled.
Because we are not longer want to stay in sync with NetBSD's rcNG,
we should remove them, as I susspect.
2. /etc/rc.d/routed script:
if checkyesno gated && checkyesno routed; then
warn "gated and routed both requested to be run: only running gated."
return 1
fi
We don't have gated, so this should be probably removed.
I'm going to commit 'nojail' flag for scripts that I know are usless
inside jail, there are still some scripts that I can't decide about this.
Bigger change is for hostname script.
Here it is:
--- hostname 30 Jul 2003 18:53:59 -0000 1.3
+++ hostname 4 Mar 2004 22:38:33 -0000
@@ -39,12 +39,20 @@ stop_cmd=":"
hostname_start()
{
- # Set the host name if it is not already set
+ # If we are not inside jail, set the host name if it is not already set.
+ # If we are inside jail set host name even if it is already set,
+ # but first check if it permitted.
#
- if [ -z "`hostname -s`" ]; then
- hostname ${hostname}
- echo "Setting hostname: `hostname`."
+ if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
+ if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then
+ return
+ fi
+ elif [ -n "`hostname -s`" ]; then
+ return
fi
+
+ hostname ${hostname}
+ echo "Setting hostname: `hostname`."
}
load_rc_config $name
--
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd at FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20040304/c69c8d68/attachment.bin
More information about the freebsd-arch
mailing list