Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2003 14:06:13 +0200 (EET)
From:      Ciprian Badescu <ciprian.badescu@alcatel.ro>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: /bin/sh logout script
Message-ID:  <Pine.GSO.4.44.0302251402050.23233-100000@mrc>
In-Reply-To: <20030225113358.GA60519@happy-idiot-talk.infracaninophi>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I saw something about this long time ago. The ideea was to use 'trap' i
login script to install a handler, and so you will catch a signal (i don't
remember what signal - INT, ??), and make a function in login script that
executes the desired actions.

Hope will help you
--
______V______   Ciprian Badescu
A L C A T E L   Mobile Networks Division R&D Center
Phone: +40 56 303100 (ext. 5786)
Fax: +40 56 295386
Email: Ciprian.Badescu@alcatel.ro

On Tue, 25 Feb 2003, Matthew Seaman wrote:

> Date: Tue, 25 Feb 2003 11:33:58 +0000
> From: Matthew Seaman <m.seaman@infracaninophile.co.uk>
> To: freebsd-questions <freebsd-questions@freebsd.org>
> Subject: Re: /bin/sh logout script
>
> On Tue, Feb 25, 2003 at 12:19:45PM +0100, dick hoogendijk wrote:
> > For bash I can use .bash_profile and .bash_logout to get things done at
> > login/logout time.
> >
> > On my fbsd machine I use /bin/sh and I can't find how to execute things
> > at logout time (login is set in .profile). I.e. I want to remove the
> > ssh-agent pig at logout time and clear the screen)
> >
> > Does /bin/sh has a logout file ??? and if so, what's it called?
>
> Hmmm... I don't think that /bin/sh does have a logout script.
> However, you may still be able to use ssh-agent using the alternative
> syntax.  You can tell ssh-agent to spawn another command, which is
> usually used for something like a window manager.
>
> Try putting a line like this at the end of your .profile:
>
>     exec ssh-agent /bin/sh
>
> which should put you into your usual shell running as a child of the
> ssh-agent.  Once in, check your environment: there should be
> SSH_AUTH_SOCK and SSH_AGENT_PID environment variables.  The ssh-agent
> will run until you exit from the shell, and you can load keys into it
> as normal.
>
> Warning: make sure you have an alternate login you can use to fix your
> account if this all goes horribly wrong and stops you being able to
> log in at all.  I haven't tested doing anything like this myself, so I
> really don't know if it will work properly or not.
>
> 	Cheers,
>
> 	Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
>                                                       Savill Way
> PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
> Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.44.0302251402050.23233-100000>