Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2004 23:40:03 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        arch@freebsd.org
Cc:        mtm@freebsd.org
Subject:   rcNG cleanups...
Message-ID:  <20040304224003.GG10864@darkness.comp.waw.pl>

next in thread | raw e-mail | index | archive | help

--sDKAb4OeUBrWWL6P
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=3D":"
=20
 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`."
 }
=20
 load_rc_config $name

--=20
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd@FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!

--sDKAb4OeUBrWWL6P
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAR7BDForvXbEpPzQRAv6XAJ9W3Vgtn4+TqPulo1ckKWOL1DmMgACgmX5J
GqzT4PSLV3bZcXc45XgREHw=
=fPDi
-----END PGP SIGNATURE-----

--sDKAb4OeUBrWWL6P--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040304224003.GG10864>