SUMMARY - Check for home

From: Bill Nolf (
Date: Thu May 06 1993 - 02:08:14 CDT

Yea Team!

Original Post -

I need suggestion on how to set a "front-end" to the users shell. In our
network sometimes (not often) when user login in their home directory is
not mounted for some reason. I would like to be able to check to see if their
home is there before letting them in. I don't want them to go to the /
partition. Most of the time, they don't even see the message about
not having a HOME.

If I could check if their home exists, if not display message and log them out,
else continue into their shell.

Responses -

The reponses fell into two catagories, 1) create a front-end (What I asked for)
or 2) In the /.login add a check to see if / is your home directory.

I went with the #2 option, because
 The main problem with a front-end is that most UNIX programs assume that
 what they see in the passwd map will actually be a shell, and they'll sometimes run it (eg editors). This might not be a problem to you, but it might drive
 some people up the wall and such changes are not guaranteed to work past
 your next upgrade. (Reason supplied by Steve Kilbane).
Also, I seem easier to can the .login file.

  Submitted by Mike Maciolek
        cd /bin; ln csh -csh
        cat <<EOF >/bin/csh_front
        #!/bin/sh -
        if [ "$HOME" = "/" ]; then
                echo ""; echo "No home directory. Login denied."; echo ""
        exec /bin/-csh
        chmod 755 /bin/csh_front

Then Change their default login shells to '/bin/csh_front', or
an appropriate alternate front-end for other shells.

-------- /.login --------- Submitted by
# @(#)login 1.7 89/09/05 SMI
if( ~$user != "/" ) then
        echo ""
        echo Physics directories are temporarily unavailable.
        echo WARNING: Logging in in directory /.
        echo Please cd to somewhere sensible.

Other suggestions:
>From Jeff Kays - - try cknfs - which is a program checks
                for dead NFS servers. I am still check this out to see
                what it can do for me.

I know I didn't do justice for some of your suggestions, they were all great.

Thanks to:

Jeff Kays -
Curt Vandetta -
Mike Maciolek -
Dan Stromberg -
John Justin Hough -
Steve Philson -
Chris Dale -
Robert Evans -
Kevin Sheehan -
David T. Bath -
Barry Margolin - barmar@Think.COM
Richard Czech -
Geert Jan de Groot -
Malcolm C. Strickland -
Tom Olin -
Morry Katz

Bill Nolf
Logicon 703-318-1074 ex-202
1831 Wiehle Ave.
Reston, VA 22090

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:48 CDT