From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 10 07:41:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D262C1065670 for ; Fri, 10 Sep 2010 07:41:27 +0000 (UTC) (envelope-from thespin@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 983658FC0C for ; Fri, 10 Sep 2010 07:41:27 +0000 (UTC) Received: by iwn34 with SMTP id 34so2235944iwn.13 for ; Fri, 10 Sep 2010 00:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bMc3u6SqyBKBeHGAodyOtz/qXsYJjUYGfE4JXa9WmkI=; b=FM6nO2vb4UPgnNM0n+AgvjYp9W0YdCO/LoUslIaOO9givIJAWXpQwMwlc/PDr64x31 KWqWJjJDKR4zFRzPe44D5ATDsRmjsE9rm+F49K+dvYmAPCtZ7fBxmjHg0EA7iH5Kdn1s QbZCcItXvx7vEvBTI4PaLf6Vs28vL+iUgGVt8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=s4ZokGYD62Eq9EZG3LtGNth76EcvsaNf4h6puQD5otXtZXnA4j4dRmbPOBY4H1cCcE QIpj0NpckhzEDA7aOvuInaEGg7587CRI+bcRqSWKN/tXqvWRaLQ2cwb//EOGmDf0psKz rXIC9FoM/UxMB+jwt2cnfIDW7/HsDVRxO8NSM= MIME-Version: 1.0 Received: by 10.231.171.18 with SMTP id f18mr591628ibz.9.1284102880029; Fri, 10 Sep 2010 00:14:40 -0700 (PDT) Received: by 10.231.13.73 with HTTP; Fri, 10 Sep 2010 00:14:39 -0700 (PDT) In-Reply-To: <1009101529500.2000@smasher> References: <1009101529500.2000@smasher> Date: Fri, 10 Sep 2010 00:14:39 -0700 Message-ID: From: Evan Geller To: Atom Smasher Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Aryeh Friedman Subject: Re: How to disallow logout X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 07:41:27 -0000 Perhaps you could write something to wrap your shell... basically you could set your login shell to this wrapper. First thing the wrapper would do is exec and wait on the shell, and when the shell exits, check what needs to be checked, and should any of these checks fail, respawn the shell and dump the user back into their login shell. That way you can't neglect any funky corner cases of the shell exiting... the shell exits, the checks happen. In this example, the user is forced to exit 3 times. The experience is pretty seemless, the only issue is that the user will lose their environment after failing and ending up back in the new respawned shell, but I don't see how this would be an issue if the user is hastefully logging out. shell-A$ for i in 1 2 3; do bash; echo poop; done child-1-of-A$ exit exit poop child-2-of-A$ exit exit poop child-3-of-A$ exit exit poop shell-A$ exit exit parent-of-A% exit E On Thu, Sep 9, 2010 at 8:34 PM, Atom Smasher wrote: > On Thu, 9 Sep 2010, Aryeh Friedman wrote: > >> I have a directory that must not exist on logout and rm -rf is not >> sufficent to do it because the contents need to be processed by our vers= ion >> control system. > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > what i would do... make an alias or function of "logout" and/or "exit" in > the init file that's parsed when the shell starts. alias it to a script o= r > assign it to a function that does what you need. > > if your shell supports logging out with ^D (or any other keybinding) then > the details may be shell-specific, but the idea would be to either disabl= e > it, or bind it to the script. > > > -- > =A0 =A0 =A0 =A0...atom > > =A0________________________ > =A0http://atom.smasher.org/ > =A0762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 > =A0------------------------------------------------- > > =A0 =A0 =A0 =A0"The reasonable man adapts himself to the world; the > =A0 =A0 =A0 =A0 unreasonable one persists in trying to adapt the world to > =A0 =A0 =A0 =A0 himself. Therefore all progress depends on the > =A0 =A0 =A0 =A0 unreasonable man." > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- George Bernard Shaw > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " > --=20 --- Evan Geller thespin@gmail.com