From owner-freebsd-questions@FreeBSD.ORG Fri Aug 4 17:18:59 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 2E8D416A4DD for ; Fri, 4 Aug 2006 17:18:59 +0000 (UTC) (envelope-from andrewgould@yahoo.com) Received: from web35315.mail.mud.yahoo.com (web35315.mail.mud.yahoo.com [66.163.179.109]) by mx1.FreeBSD.org (Postfix) with SMTP id BF58B43D45 for ; Fri, 4 Aug 2006 17:18:58 +0000 (GMT) (envelope-from andrewgould@yahoo.com) Received: (qmail 21812 invoked by uid 60001); 4 Aug 2006 17:18:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=thjmzJfrdj9fWsJDe3evLfR2F3wLfOCxCXwHf7r2mzyxqu6ppL7wUS1+aTKkOnGXcUw5iwAjpgcqLWxkRqkPmM4sO+988JV8eQ4j2CXnfCjYNjwneMyvTAEHJizKyJt0g6I8pM3gD3sWQX91eGqUK40Sb1W2D1OtFrmeJLePl3k= ; Message-ID: <20060804171858.21810.qmail@web35315.mail.mud.yahoo.com> Received: from [206.255.31.21] by web35315.mail.mud.yahoo.com via HTTP; Fri, 04 Aug 2006 10:18:58 PDT Date: Fri, 4 Aug 2006 10:18:58 -0700 (PDT) From: Andrew Gould To: DW , freebsd-questions@freebsd.org In-Reply-To: <44D37F26.8080307@dwinner.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: .bash_logout and shutdown -- need ideas 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: Fri, 04 Aug 2006 17:18:59 -0000 --- DW wrote: > Andrew Gould wrote: > > --- DW 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