From owner-freebsd-questions@FreeBSD.ORG Sun Feb 7 04:03:09 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F3E41065670 for ; Sun, 7 Feb 2010 04:03:09 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id DFF7A8FC08 for ; Sun, 7 Feb 2010 04:03:08 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id o173nxTS078330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 6 Feb 2010 19:49:59 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id o173nxXk078329; Sat, 6 Feb 2010 19:49:59 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA19723; Sat, 6 Feb 10 19:47:49 PST Date: Sat, 06 Feb 2010 19:45:12 -0800 From: perryh@pluto.rain.com To: norgaard@locolomo.org Message-Id: <4b6e3748.uodc5baNdIuDUSwW%perryh@pluto.rain.com> References: <4B6E0F66.4060707@locolomo.org> In-Reply-To: <4B6E0F66.4060707@locolomo.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: Howto run privileged commands on login/logout X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 04:03:09 -0000 Erik Norgaard wrote: > I'm playing around with diskless operation. I'd like to be able > to run privileged commands when a user logins or logs out: > > - on login, nfs mount the user's home directory (ok, not critical, > I can mount /home) Or, better yet, use an automounter. > - on logout a system reboot to clean up any temporary files left > from the session. I'm not aware of any existing, simple method to handle this part. It might not be all that difficult to hack something into getty(8) or init(8). Another possibility would be to clean /tmp and /var/tmp in the .logout script, which should not require any special privs.