From owner-freebsd-questions Tue Feb 25 4: 0:20 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0506B37B401 for ; Tue, 25 Feb 2003 04:00:18 -0800 (PST) Received: from smail2.alcatel.fr (colt-na7.alcatel.fr [62.23.212.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7430943F3F for ; Tue, 25 Feb 2003 04:00:16 -0800 (PST) (envelope-from ciprian.badescu@alcatel.ro) Received: from ns.tm.alcatel.ro (ns.tm.alcatel.ro [155.132.154.34]) by smail2.alcatel.fr (ALCANET/NETFR) with SMTP id h1PC0BtX006586 for ; Tue, 25 Feb 2003 13:00:12 +0100 Received: FROM mail.tm.alcatel.ro BY ns.tm.alcatel.ro ; Tue Feb 25 13:59:02 2003 +0200 Received: from mrc.mrc.alcatel.ro (unverified [172.25.128.124]) by mail.tm.alcatel.ro (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 25 Feb 2003 13:58:29 +0200 Received: from mrc (mrc [172.25.128.124]) by mrc.mrc.alcatel.ro (8.12.6/8.12.6/mrc.alcatel.ro) with ESMTP id h1PC6D2r008072; Tue, 25 Feb 2003 14:06:19 +0200 (EET) Date: Tue, 25 Feb 2003 14:06:13 +0200 (EET) From: Ciprian Badescu X-X-Sender: badescu@mrc To: Matthew Seaman Cc: freebsd-questions Subject: Re: /bin/sh logout script In-Reply-To: <20030225113358.GA60519@happy-idiot-talk.infracaninophi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 > To: freebsd-questions > 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