[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#122817: marked as done (base-files: Please provide profile.d hook in /etc/profile)



Your message dated Fri, 06 Jun 2008 11:23:31 -0700
with message-id <[🔎] 87skvqtobg.fsf@windlord.stanford.edu>
and subject line Rejected: Bug#122817: Please provide profile.d hook in /etc/profile
has caused the Debian Bug report #122817,
regarding base-files: Please provide profile.d hook in /etc/profile
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
122817: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=122817
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: base-files
Version: 3.0
Severity: important
Tag: patch

First of all, I'm setting this bug as important due to the fact that, even
if it works as is some packages (bastille and user-es for example) have to do
some very nasty stuff to work properly. 

The issue here is: how do packages include/change information in the user's
environment without changing /etc/profile? Currently there is no way.

Talking with people in bastille-devel it seems that RedHat implements a nice
hook very similar to what we currently due for Emacs elisp files (at
/etc/emacs/site-start.d/)

In /etc/profile Red Hat has:

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done

In /etc/csh.login Red Hat has:

test -d /etc/profile.d
if ($status == 0) then
        set nonomatch
        foreach i ( /etc/profile.d/*.csh )
                test -f $i
                if ($status == 0) then
                        source $i
                endif
        end
        unset i nonomatch
endif


Thus. I would suggest including the same code snippets in Debian's /etc/profile
and include an empty /etc/profile.d/ in the base-files package (then ask the
tcsh package maintainer to do the same thing in /etc/csh.login)

Yes, I know, we are on freeze time. However I consider that these proposal
has:

a) no major impact on /etc/profile as is
b) no major changes on base-files
c) provides a basic setup so packages can be changed once Debian 3.0 is released
in order to do things properly and don't touch other packages' files.

Thus, I'm attaching a patch to the base-files source that could be easily
applied to the base-files 3.0 package.

Yes, information regarding /etc/profile.d could/should? be added to
Debian-Policy too. I adjoint also a patch for the Debian policy's policy.sgml
file which describes the reasoning behind /etc/profile.d (to avoid having
package or administrators script modify /etc/profile).

Take a look at my site's /etc/profile for an example of where the current policy
leads to... (I have removed some sentitive-information lines, so its somewhat
bigger)


	Regards

	Javier Fernández-Sanguino Peña

-- System Information
Debian Release: 3.0
Kernel Version: Linux avalon 2.4.13 #1 lun nov 5 19:33:10 CET 2001 i686 unknown

Versions of the packages base-files depends on:
ii  base-passwd    3.2.1          Debian Base System Password/Group Files
ii  gawk           3.1.0-1        GNU awk, a pattern scanning and processing l
	^^^ (Provides virtual package awk)

--- Begin /etc/debian_version (modified conffile)
3.0

--- End /etc/debian_version

--- Begin /etc/issue (modified conffile)
c
Debian GNU/\s \r \n \l

--- End /etc/issue

--- Begin /etc/profile (modified conffile)
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
if [ "$BASH" ]; then
  PS1='\u@\h:\w\$ '
  ignoreeof=2
  HISTCONTROL=ignoredups
else
  if [ "`id -u`" -eq 0 ]; then
    PS1='# '
  else
    PS1='$ '
  fi
fi
export PATH PS1
umask 022
eval `lesspipe`
LESSCHARSET=latin1
export LESSCHARSET
EDITOR=pico
export EDITOR
VISUAL=vi
export VISUAL
export CORELHOME=/opt/corel
export CVSROOT=/usr/local/cvs
export XNLSPATH=/usr/X11R6/lib/X11/nls
LANG=spanish
LANGUAGE=spanish
LC_MESSAGES=spanish
export LANG LANGUAGE LC_MESSAGES
http_proxy=http://avalon-dat:3128/
ftp_proxy=http://avalon-dat:3128/
export http_proxy ftp_proxy
export PATH PAGER DISPLAY EDITOR VISUAL
eval `dircolors`
alias ls='ls -F --color=auto '
alias ll='ls -F -l'
alias dir='ls -F --color=auto -la'
alias vdir='ls -F --color=auto --format=long'
alias v=vdir
alias ols='/bin/ls'
alias mv='mv -i'
alias setfont='setfont /usr/share/consolefonts/lat1-16.psf'
test -f "$HOME/.bash_aliases" && source $HOME/.bash_aliases
MAIL=$HOME/Mailbox
export TERM
export MAIL
mesg y
cd
if (test -x /usr/bin/quota) then
	QUOTA='/usr/bin/quota'
elif (test -x /usr/sbin/quota) then
	QUOTA='/usr/sbin/quota'
else
	QUOTA='echo ""'
fi
QUOTA='echo ""'
if ($QUOTA -v | grep -q \*) then
	echo ""
	echo "has sobrepasado tu quota"
	echo ""
	$QUOTA -v
	echo ""
	echo "debido a esto puedes perder el correo entrante por falta de espacio de disco."
	echo "Libera espacio en la cuenta para evitar perder el correo."
fi
hash ytalk 2>/dev/null && alias talk='ytalk'
TMOUT=120	# timeout 2 minutos
test -x /usr/bin/check-sendfile && /usr/bin/check-sendfile || /bin/true
alias wp='/usr/local/wp/wpbin/xwp'
netpref=$HOME/.netscape/preferences.js
if ! grep -q '^user_pref("browser.cache.directory", "/tmp/netscape-cache/' $netpref 2>/dev/null || ! grep -q '^user_pref("browser.cache.disk_cache_size", 1000);' $netpref || ! grep -q '^user_pref("browser.cache.memory_cache_size", 1000);' $netpref || ! gr
ep -q '^user_pref("network.proxy.http", "avalon-dat");' $netpref || ! grep -q '^user_pref("network.proxy.ftp", "avalon-dat");' $netpref || ! grep -q '^user_pref("browser.startup.homepage"' $netpref || ! grep -q '^user_pref("network.proxy.type", 1);' $netp
ref
then
	( cd $HOME/.netscape/ 2>/dev/null || exit;
	pon_netscape_prefs.awk < preferences.js > preferences.js.tmp && \
		cat preferences.js.tmp > preferences.js;
		rm -f preferences.js.tmp;
	)
fi
test -d /tmp/netscape-cache -a ! -d /tmp/netscape-cache/$USER && \
	mkdir /tmp/netscape-cache/$USER

--- End /etc/profile

Patch for base-files-3.0

-----------------------------------------------------------------

Only in base-files-3.1/: build
diff -ru base-files-3.0/debian/changelog base-files-3.1/debian/changelog
--- base-files-3.0/debian/changelog	Wed Nov 28 11:22:52 2001
+++ base-files-3.1/debian/changelog	Fri Dec  7 13:10:06 2001
@@ -1,3 +1,10 @@
+base-files (3.1) unstable; urgency=high
+
+  * Included a mechanism for other packages to start scripts through
+  /etc/profile.d
+
+ -- Javier Fernandez-Sanguino Pen~a <jfs@computer.org>  Fri,  7 Dec 2001 13:09:18 +0100
+
 base-files (3.0) unstable; urgency=medium
 
   * Changed issue, issue.net and debian_version to read "3.0".
Only in base-files-3.1/debian: changelog.dch~
diff -ru base-files-3.0/debian/directory-list base-files-3.1/debian/directory-list
--- base-files-3.0/debian/directory-list	Wed Nov 28 11:16:14 2001
+++ base-files-3.1/debian/directory-list	Fri Dec  7 13:07:54 2001
@@ -37,3 +37,4 @@
 var/run
 var/spool
 var/tmp
+etc/profile.d
Only in base-files-3.1/debian: files
Only in base-files-3.1/debian: preinst
Only in base-files-3.1/debian: tmp
diff -ru base-files-3.0/etc/profile base-files-3.1/etc/profile
--- base-files-3.0/etc/profile	Wed Dec 22 19:46:52 1999
+++ base-files-3.1/etc/profile	Fri Dec  7 13:07:43 2001
@@ -13,6 +13,13 @@
   fi
 fi
 
+for script in /etc/profile.d/*.sh ; do
+        if [ -x $script ]; then
+                . $script
+        fi
+done
+
+
 export PATH PS1
 
 umask 022

---------------------------------------------------------

Patch for Debian policy (package version 3.5.6.0)

--- policy.sgml Fri Dec  7 13:19:10 2001
+++ policy.orig.sgml    Fri Dec  7 13:13:31 2001
@@ -5303,16 +5303,6 @@
          file of the <prgn>base-files</prgn> package, other packages must not
          put any environment variables or other commands into that
          file.</p>
-
-       <p>If a package cannot be set with a wrapper script in order
-       to include necessary environment values, or if an administrator
-       needs to place a script to be run when a user's shell starts,
-       the <prgn>base-files</prgn> package provides a hook mechanism.
-       Files in <tt>/etc/profile.d/</tt> will be loaded when a shell runs
-       <tt>/etc/profile</tt>. Sample packages that will have to use this
-       mechanism include those that setup the user's environment for a
-       given language definition, or those that provide useful aliases
-       for the user's shell.</p>
       </sect>
     </chapt>



--- End Message ---
--- Begin Message ---
This proposal asks for an /etc/profile.d, the contents of which would be
sourced by every shell and which could be used to set environment
variables for all users.

This is contrary to the intent of Policy 9.9, which explicitly prohibits
programs from depending on environment variables to get reasonable
defaults.  No consensus for changing that provision was reached in the
discussion of this proposal.  This proposal is also problematic due to the
variety of shells in Debian, as discussed further in the bug.

I am rejecting this proposal.

If you disagree with the rejection of this proposal for reasons that
weren't raised in the prior bug discussion, please raise them in this bug.
If you disagree with the rejection of this proposal for reasons already
raised in the bug, the path of appeal for a Policy proposal rejection is
to the tech-ctte.  See http://www.debian.org/devel/tech-ctte for how to
make an appeal to the tech-ctte.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


--- End Message ---

Reply to: