metash - common configuration file for all shells
-------------------------------------------------

Unix gives the user the freedom to choose between different shells.
The mourner of it is the system administrator: if for example the
PATH-variable should be expanded to include /opt/bin, he has to

    (1) remember the name of the configuration-files of all shells
    (2) know the syntax of their files
    (3) change every individual file by hand.

Their is already a software available which allows setting of
resource-limit in a shell-independant manner. It's name is "lshell".
Now, the idea behind it can be expanded at least to environment variables
and other facilities which are inherited automatically to child processes
(are there any left?).

To demonstrate the extension, I've written a small sh-script to source in a
central configuration file just before the shell of the user is
started. E.g. you could set the environment variable PRINTER or LANG this
way for all your shells in /etc/meta/environment

        case $GROUPID in
          "20900") PRINTER=declaser ;;
          "21000") PRINTER=klaser   ;;
          "32128") PRINTER=katalog  ;;
          "20970") PRINTER=lj4m     ;;
          "20950") PRINTER=declaser ;;
        esac

The features of "lshell" are implemented into "metash", too. But,
it uses a table in /etc/meta/limits instead of a somewhat cryptic
configuration-string:

        #       who         cpu time  memory  jobs    files
        user    truemper        3600   24000    64        -
        uid     1000-2000        900   16000    64        -
        user    *                900    8000    32       32

It could be extended for other resource-limits, but I'm just to lazy.
The reason for releaseis the fact that I can't invest any time into
it's development in the foreseeable future.

Playing with metash should be fairly safe as long as you use an extra
account for that. To install metash:

	cp metash /bin
	cd /bin
	chmod 755 metash
	mkdir meta
	cd meta
	ln -s ../metash bash
	ln -s ../metash tcsh

Now, if you use "/bin/meta/bash" as login-shell for a user, the link will
be followed on login and "/bin/metash" will be executed. Inside the script
the variable name $0 contains the name of the link and "meta/" will be cut
from it, leaving "/bin/bash". This core functinallity is achvied with the
last lines of code:

	set -a
	if [ -f "/etc/meta/environment" ]
	then
	        source /etc/meta/environment
	fi
	set +a
	
	MYNAME=$0
	SHELLBIN="${MYNAME%/meta/*}${MYNAME#*/meta}"
	unset MYNAME
	
	if [ -x "$SHELLBIN" ]
	then
	    exec $SHELLBIN $ORGARGS
	else
	    echo "Couldn't execute $SHELLBIN using fallback shell /bin/sh"
	    exec /bin/sh
	fi

Everything before that implements the limitation of the resources.
For further discussion, there is a mailinglist "metash@shop.de".
Subscription is done with

	echo "subscribe" | mail metash-request@shop.de

The archive is available via http://www.shop.de/linux/archives/metash/


Regards
-Winfried