Date: Fri, 10 Sep 2010 00:14:39 -0700 From: Evan Geller <thespin@gmail.com> To: Atom Smasher <atom@smasher.org> Cc: freebsd-hackers@freebsd.org, Aryeh Friedman <aryeh.friedman@gmail.com> Subject: Re: How to disallow logout Message-ID: <AANLkTimJ4u=fsfzOApDmwx3CAvAN%2BPNEfMRd_LUsAdja@mail.gmail.com> In-Reply-To: <1009101529500.2000@smasher> References: <AANLkTim4OG2124dVtEHFSR06c7sF-nnMA7bgfPApTywk@mail.gmail.com> <1009101529500.2000@smasher>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <atom@smasher.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimJ4u=fsfzOApDmwx3CAvAN%2BPNEfMRd_LUsAdja>