From nobody@FreeBSD.org  Fri May 25 10:30:27 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B957516A400
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 May 2007 10:30:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D9BC13C448
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 May 2007 10:30:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4PAURpV001107
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 May 2007 10:30:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4PAURqJ001104;
	Fri, 25 May 2007 10:30:27 GMT
	(envelope-from nobody)
Message-Id: <200705251030.l4PAURqJ001104@www.freebsd.org>
Date: Fri, 25 May 2007 10:30:27 GMT
From: Chris Calvey<chris@infosec.yi.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc start-up scripts broken after X11R6 symlink made
X-Send-Pr-Version: www-3.0

>Number:         112985
>Category:       conf
>Synopsis:       [patch] rc start-up scripts broken after X11R6 symlink made
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 25 10:40:04 GMT 2007
>Closed-Date:    Sat Jun 21 18:17:05 UTC 2008
>Last-Modified:  Sat Jun 21 18:17:05 UTC 2008
>Originator:     Chris Calvey
>Release:        6.2-p4
>Organization:
>Environment:
FreeBSD enigmathica.localdomain 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Fri Apr 27 15:17:47 BST 2007     root@enigmathica.localdomain:/usr/obj/usr/src/sys/ENIGMATHICA  i386
>Description:
The upgrade notes for xorg release 7 state that the existing /usr/X11R6
directory tree contents be moved to /usr/local, and the /usr/X11R6 directory
be replaced by a symklink to /usr/local. See /usr/ports/UPDATING for the
full details.

Making this modification caused the rc start-up sequence for the
/usr/local/etc/rc.d directory to be executed _twice_ during system boot.
This was due to the presence of the /usr/X11R6/etc/rc.d directory in the
local_startup variable in the /etc/defaults/rc.conf file.

In addition to this the /usr/X11R6 directory is mentioned a number of
times in the /etc directory tree, i.e. MANPATH settings etc. These paths
are probably redundant, at least in some point in the future.
>How-To-Repeat:
Replace the /usr/X11R6 directory by a symlink to /usr/local and re-boot.

>Fix:
Apply the attached patch:

cd /etc
patch -p1 < <path-to-patch>/X11R6-path-rm.patch


Patch attached with submission follows:

diff -ur etc.orig/defaults/periodic.conf etc/defaults/periodic.conf
--- etc.orig/defaults/periodic.conf	Mon Jan 29 11:57:53 2007
+++ etc/defaults/periodic.conf	Fri May 25 10:17:07 2007
@@ -20,7 +20,7 @@
 periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local"
 
 # periodic script dirs
-local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic"
+local_periodic="/usr/local/etc/periodic"
 
 
 # Daily options
diff -ur etc.orig/defaults/rc.conf etc/defaults/rc.conf
--- etc.orig/defaults/rc.conf	Mon Jan 29 11:58:11 2007
+++ etc/defaults/rc.conf	Fri May 25 10:16:27 2007
@@ -55,7 +55,7 @@
 varmfs_flags="-S -M"	# Extra mount options for the mfs /var
 populate_var="AUTO"	# Set to YES to always (re)populate /var, NO to never
 cleanvar_enable="YES" 	# Clean the /var directory
-local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs.
+local_startup="/usr/local/etc/rc.d" # startup script dirs.
 script_name_sep=" "	# Change if your startup scripts' names contain spaces
 rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
 
@@ -516,14 +516,14 @@
 clear_tmp_enable="NO"	# Clear /tmp at startup.
 clear_tmp_X="YES" 	# Clear and recreate X11-related directories in /tmp
 ldconfig_insecure="NO"	# Set to YES to disable ldconfig security checks
-ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/lib/compat/pkg"
+ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg"
 			# shared library search paths
 ldconfig32_paths="/usr/lib32" # 32-bit compatibility shared library search paths
-ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout"
+ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout"
 			# a.out shared library search paths
-ldconfig_local_dirs="/usr/local/libdata/ldconfig /usr/X11R6/libdata/ldconfig"
+ldconfig_local_dirs="/usr/local/libdata/ldconfig"
 			# Local directories with ldconfig configuration files.
-ldconfig_local32_dirs="/usr/local/libdata/ldconfig32 /usr/X11R6/libdata/ldconfig32"
+ldconfig_local32_dirs="/usr/local/libdata/ldconfig32"
 			# Local directories with 32-bit compatibility ldconfig
 			# configuration files.
 kern_securelevel_enable="NO"	# kernel security level (see init(8)),
diff -ur etc.orig/login.conf etc/login.conf
--- etc.orig/login.conf	Thu Sep 14 13:42:11 2006
+++ etc/login.conf	Fri May 25 10:17:49 2007
@@ -36,7 +36,7 @@
 	:welcome=/etc/motd:\
 	:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES: \
 	:path=/sbin /bin /usr/sbin /usr/local/bin /usr/bin /usr/games \
-	/usr/local/sbin /usr/X11R6/bin /usr/local/gnu-autotools/bin \
+	/usr/local/sbin /usr/local/gnu-autotools/bin \
         /usr/local/mpi/openmpi/bin ./ ~/bin: \
 	:nologin=/var/run/nologin:\
 	:cputime=unlimited:\
@@ -152,7 +152,7 @@
 ## users of X (needs more resources!)
 ##
 #xuser:\
-#	:manpath=/usr/share/man /usr/X11R6/man /usr/local/man:\
+#	:manpath=/usr/share/man /usr/local/man:\
 #	:cputime=4h:\
 #	:datasize=12M:\
 #	:vmemoryuse=infinity:\
diff -ur etc.orig/manpath.config etc/manpath.config
--- etc.orig/manpath.config	Mon Jun 26 17:30:59 2006
+++ etc/manpath.config	Fri May 25 10:18:28 2007
@@ -17,14 +17,12 @@
 # check if the directory exists and if it does, add it to MANPATH
 #
 OPTIONAL_MANPATH	/usr/local/man
-OPTIONAL_MANPATH	/usr/X11R6/man
 #
 # set up PATH to MANPATH mapping
 #
 MANPATH_MAP	/bin			/usr/share/man
 MANPATH_MAP	/usr/bin		/usr/share/man
 MANPATH_MAP	/usr/local/bin		/usr/local/man
-MANPATH_MAP	/usr/X11R6/bin		/usr/X11R6/man
 #
 # set man locales, if needed
 #


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Sat Jun 21 18:05:17 UTC 2008 
State-Changed-Why:  
Close, this was fixed in HEAD in pretty much the same way as the patch 
in the PR about 12 months ago, and in STBLE with a workaround in rc.subr. 
Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112985 
>Unformatted:
