Bug#1834: kubla@goofy.zdv.Uni-Mainz.de: /etc/profile on Debian Linux]
Ian Murdock writes: A little complicated, perhaps, but he does have good suggestions. Try. I'd like to take issue with a few of the bits, though: # /etc/profile - sh(1) initialization file for Linux-based systems. # Copyright (C) 1993-1995 by Dominik Kubla, Dominik [EMAIL PROTECTED] ... # Set the umask: # umask 000 # -rwxrwxrwxInsane - Calm down, the doctor's here. # umask 002 # -rwxrwxr-xInnocent - Gee, i hear Santa coming! umask 022 # -rwxr-xr-xStandard - Just plain old number 22. # umask 027 # -rwxr-x---Cautious - Who are you and can you prove it? # umask 077 # -rwx--Paranoid - The martians are after me ... This would interwork badly with user private groups and our scheme for ensuring that people's umask is right. The default default umask, so to speak, is 002 and isn't innocent :-). # Set core file size to 0, if a user wants cores, he will have to enable them. ulimit -c 0 This makes handling bug reports a lot harder. # Some login programs export LOGNAME, some USER. Make that consistent. if [ -z $USER ]; then USER=$LOGNAME export USER elif [ -z $LOGNAME ]; then LOGNAME=$USER export LOGNAME fi This is the business of login, which we control, not of the /etc/profile. [ environment settings for ARCH, TZ, HOSTNAME, DOMAIN, MAIL, PATH, WWW_HOME, NNTPSERVER, NLSPATH c ] Yuk. An ARCH variable is a site-specific thing, and the FSSTND people are thinking of withdrawing arch (which isn't available everywhere) in favour of uname (which is). TZ, MAIL, WWW_HOME, NNTPSERVER, NLSPATH should not be set. If they need to be then the program that is trying to use them is broken. HOSTNAME and DOMAIN are local policy and not particularly helpful. The usual way to do this is to use `hostname' in whatever script in question. Setting the PATH is plausible, but we should set it to one specific thing, rather than having lots of conditionals. [ fortune, calendar, c ] This doesn't belong in the global /etc/profile, because then users can't disable it. Most of this belongs in /etc/skel/.profile if anywhere. Note that the more stuff we put in /etc/skel/.profile or /etc/profile the more we will have to edit it, and the more work sysadmins (who will have to edit them too) will have to do because of conffiles prompts relating to these files. Ian.
Re: Bug#1834: [kubla@goofy.zdv.Uni-Mainz.de: /etc/profile on Debian Linux]
[/etc/profile suggestion] if [ -f $HOME/$ARCH-linux ]; then PATH=$HOME/$ARCH-linux:$PATH else mkdir $HOME/bin 2/dev/null PATH=$HOME/bin:$PATH fi I don't think /etc/profile should be creating directories in my home directory. I think if is someone is sufficiently Unix literate to be adding their own commands, they can probably make the appropriate modifications to PATH in their own .profile. Maybe put PATH=$HOME/bin:$PATH in the skel version, commented out? Steve Greenland -- The Mole - I think, therefore I scream The Fourth Dimension is a shambles? Nobody ever empties the ashtrays. People are SO inconsiderate. [Doonsebury]
Re: Bug#1834: [kubla@goofy.zdv.Uni-Mainz.de: /etc/profile on Debian Linux]
Steve Greenland writes: [/etc/profile suggestion] if [ -f $HOME/$ARCH-linux ]; then PATH=$HOME/$ARCH-linux:$PATH else mkdir $HOME/bin 2/dev/null PATH=$HOME/bin:$PATH fi I don't think /etc/profile should be creating directories in my home directory. Agree. They should be created when the account is created, or (IMHO better) not at all. I think if is someone is sufficiently Unix literate to be adding their own commands, they can probably make the appropriate modifications to PATH in their own .profile. Maybe put PATH=$HOME/bin:$PATH in the skel version, commented out? I don't see any harm in including the directory in the PATH even if it's not there. Or even do if test -d $HOME/bin; then PATH=$HOME/bin:$PATH;fi ttfn/rjk
Re: Bug#1834: kubla@goofy.zdv.Uni-Mainz.de: /etc/profile on Debian Linux]
Hi, the file /etc/profile should contain only absolut necessary entries. Of course there are thousands of tricks one could do in /etc/profile, but this stuff (and explanative examples) belong to /usr/doc/examples. Nobody really wants to mess around with other people taste regarding to enviroment variables and such. Which setting is essential, which not? How do they interact which each other? Here is a very useful setting for you profile. It should be immediatly included in the debian profile. ;-) - snipp - if [ $TERM = xterm -o $TERM = vs100 ] then PROMPT_COMMAND='echo -ne \033]2;Machine: $HOST\ User: $LOGNAME\ Directory: $PWD\007\033]1;$LOGNAME:$HOST\007' export PROMPT_COMMAND fi - snipp - Of course, LOGNAME and HOST must be set ... Have fun Winfried
Bug#1834: [kubla@goofy.zdv.Uni-Mainz.de: /etc/profile on Debian Linux]
Package: bash Version: 1.14.4-2 A little complicated, perhaps, but he does have good suggestions. --- Start of forwarded message --- Date: Fri, 3 Nov 1995 16:42:03 +0100 From: Dominik Kubla [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: /etc/profile on Debian Linux Cc: [EMAIL PROTECTED] Hello Ian, I just started to recompile the bash package for my all ELF system. That was when i discovered that the /etc/profile provided by Debian is somewhat inappropriate: Novice users wil have no idea how to write a proper profile for their system. This never occured to me since our Debian systems at the Computing Center share a common profile with our other Unix systems. So i thought it to be a good idea to donate the /etc/profile from my home system to the Debian project. I added some Debian specific PATH options, that is all i needed to change. As you can see from the copyright, this profile has been used quite a while... I hope you find it useful and incorporate it into the bash-package ... Yours, Dominik PS. It seems that the effort of porting Debian to m68k-linux has stalled: I haven't heard anything of the people interested in the port for a while. And since our TT has broken down, i am left without a possibility to do it on my own. As for the alpha-linux port: The AlphaPC's are starting to arrive one-by-one. As soon as i can grab one, i will start to work on this port. But for now i am to busy with my courses at University ... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= : # # /etc/profile - sh(1) initialization file for Linux-based systems. # Copyright (C) 1993-1995 by Dominik Kubla, Dominik [EMAIL PROTECTED] # # $Id: profile,v 1.3 1995/11/03 15:18:28 kubla Exp $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Set the umask: # umask 000 # -rwxrwxrwxInsane - Calm down, the doctor's here. # umask 002 # -rwxrwxr-xInnocent - Gee, i hear Santa coming! umask 022 # -rwxr-xr-xStandard - Just plain old number 22. # umask 027 # -rwxr-x---Cautious - Who are you and can you prove it? # umask 077 # -rwx--Paranoid - The martians are after me ... # Set core file size to 0, if a user wants cores, he will have to enable them. ulimit -c 0 # Some login programs export LOGNAME, some USER. Make that consistent. if [ -z $USER ]; then USER=$LOGNAME export USER elif [ -z $LOGNAME ]; then LOGNAME=$USER export LOGNAME fi # Don't force root through the system profile, especially not in an NFS setup! if [ $USER = root -o $USER = toor ] ; then echo User is root - no profile# Using exit is a bad idea ... else # Architecture ARCH=`/bin/arch` # /bin/arch is specified by the FSSTND. export ARCH # Timezone if [ -f /etc/timezone ]; then TZ=`cat /etc/timezone` export TZ fi # Hostname and domain if [ -z $HOSTNAME ]; then HOSTNAME=`/bin/hostname` readonly HOSTNAME fi if [ -z $DOMAIN ]; then DOMAIN=`/bin/dnsdomainname 2/dev/null` readonly DOMAIN fi export HOSTNAME DOMAIN # Mailbox MAIL=/var/spool/mail/$LOGNAME export MAIL # Path PATH=/bin:/usr/bin:/usr/games:/usr/local/bin:/usr/local/games export PATH if [ -f $HOME/$ARCH-linux ]; then PATH=$HOME/$ARCH-linux:$PATH else mkdir $HOME/bin 2/dev/null PATH=$HOME/bin:$PATH fi mkdir $HOME/scripts 2/dev/null PATH=$HOME/scripts:$PATH if [ -d /usr/X11R6/bin ]; then PATH=$PATH:/usr/X11R6/bin fi if [ -d /usr/local/X11R6/bin ]; then PATH=$PATH:/usr/local/X11R6/bin fi if [ -d /usr/bin/mh ]; then PATH=$PATH:/usr/bin/mh fi if [ -d /usr/bin/pbmplus ]; then PATH=$PATH:/usr/bin/pbmplus fi # Interactive session ? if [ -z `/usr/bin/tty 21 | grep 'not '` ]; then # Shell prompt PS1=\w \\$ # Standard editor EDITOR=ex ; export EDITOR VISUAL=vi ; export VISUAL # NNTP server if [ -f /etc/nntpserver ]; then NNTPSERVER=`cat /etc/nntpserver`; export NNTPSERVER fi WWW_HOME=http://www.uni-mainz.de/~$USER; export WWW_HOME # NLS support LANG=de ; export LANG NLSPATH=/usr/lib/locale ; export NLSPATH # Enable charset mapping if this is a vt. #if [ ! `tty | grep not` ]; then # setleds +num -caps # setmetamode meta 21 /dev/null #