[TriLUG] Login not grabbing NIS/passwd diff

Jeremy Portzer jeremyp at pobox.com
Fri Jan 24 13:35:50 EST 2003


On Fri, 2003-01-24 at 13:07, Jon Carnes wrote:
> On Fri, 2003-01-24 at 08:56, Mike Shaw wrote:
> 
> > >The only way I've found to over-ride that in Linux is
> > >use use some scripting in a .login file.  In mine I
> > >always look for the existence of bash and then switch
> > >my shell to bash if it exists on the local machine.
> > >
> > This is the first time I've had to do this since
> > Debian 2.2 or RH7.2 but what I described should work. 
> > My only thought is that the NIS master is running
> > Solaris 5.5 and the version of NIS it has could be
> > causing me problems.
> > 
> > >If you need help with something like that, let me
> > >know.
> > >
> > Yes!  I would very much like to see your work-around.
> > 
> > Thanks,
> > 
> > Mike
> > 
> > =====
> 
> This is from memory, but it's fairly simple so I can't be far off...  In
> the .login file in your home user directory put:
> 
>   if [ -x /bin/bash ]; then 
>      /bin/bash --login 
>      exit
>   fi
> 
> This checks for the existence of an executable shell "/bin/bash" and
> then launches the shell (in login mode) if it exists.  The "--login"
> tells the shell to load any environment variables and to check/use the
> .bashrc, .bash_profile and .bash_login files.

The command that runs bash can/should be "exec /bin/bash --login" --
"exec" causes the initial shell to exit at the same time it starts
bash.  That way, you won't have an extra process that's doing nothing
but hangs around, using memory.

--Jeremy





More information about the TriLUG mailing list