Date: Fri, 4 Aug 2006 10:18:58 -0700 (PDT) From: Andrew Gould <andrewgould@yahoo.com> To: DW <spock@dwinner.net>, freebsd-questions@freebsd.org Subject: Re: .bash_logout and shutdown -- need ideas Message-ID: <20060804171858.21810.qmail@web35315.mail.mud.yahoo.com> In-Reply-To: <44D37F26.8080307@dwinner.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--- DW <spock@dwinner.net> wrote: > Andrew Gould wrote: > > --- DW <spock@dwinner.net> wrote: > > > > > >> Hi all, > >> > >> Have a bit of an issue here: > >> > >> Just started using a .bash_logout script to > handle > >> doing my unison > >> commands whenever I logout at end of day so I > don't > >> forget to sync my > >> local homedir to my server before I head home. > >> > >> Works fine as long as I just do a "# exit" when > I'm > >> done. > >> > >> But more often than not, I do a "# sudo shutdown > -p > >> now". > >> > >> The problem with that though, is that the > shutdown > >> process runs as root, > >> and just drops the system, and I'm never actually > >> getting logged out as > >> much as booted out. So my .bash_logout doesn't > run, > >> and thus no unison > >> unless I remember to run it manually first. > >> > >> Any ideas on how to work around this sitch? > >> > >> Thanks, > >> DW > >> > >> > > > > Instead of using .bash_logout, why don't you > create a > > script that runs all of your logout tasks and then > > ends with 'sudo shutdown -p now'? > > > That's a good idea; I'll probably end up doing > something like that; I > was actually thinking of of just making bash aliases > for reboot and > shutdown, I guess that would do the same thing. > The other problem though I just discovered is that > that will work fine > if I'm just in on a console, but if I'm running > XFCE, and choose reboot > or shutdown from xfce's exit menu, that won't work. > If I can't find a > way to get xfce to use my exit script(s), then I > guess I'll just have to > get into the habit of bailing out to a console first > before shutting down. > > > > Andrew L. Gould > > > > I've never examined the shutdown procedures used by windows managers; but the concept should be the same. You could write a script with your logout tasks followed by the command executed by XFCE's shutdown commands. (I'm sure someone on this list can address this part.) Next, create a button or menu option on XFCE's panel to execute your script from a terminal application. Andrew L. Gould
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060804171858.21810.qmail>