From owner-freebsd-questions@FreeBSD.ORG Fri Aug 4 17:09:05 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 93F6316A4DD for ; Fri, 4 Aug 2006 17:09:05 +0000 (UTC) (envelope-from spock@dwinner.net) Received: from outbound-mail-44.bluehost.com (outbound-mail-44.bluehost.com [70.96.188.13]) by mx1.FreeBSD.org (Postfix) with SMTP id 0CF3643D6B for ; Fri, 4 Aug 2006 17:09:01 +0000 (GMT) (envelope-from spock@dwinner.net) Received: (qmail 9655 invoked by uid 0); 4 Aug 2006 17:08:57 -0000 Received: from unknown (HELO box122.bluehost.com) (67.106.44.122) by mailproxy3.bluehost.com with SMTP; 4 Aug 2006 17:08:57 -0000 Received: from [216.113.237.29] (helo=[10.10.6.20]) by box122.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1G93AO-00051D-V0 for freebsd-questions@freebsd.org; Fri, 04 Aug 2006 11:08:57 -0600 Message-ID: <44D37F26.8080307@dwinner.net> Date: Fri, 04 Aug 2006 13:08:54 -0400 From: DW User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <20060804170140.28887.qmail@web35313.mail.mud.yahoo.com> In-Reply-To: <20060804170140.28887.qmail@web35313.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {731:box122.bluehost.com:dwinnern:dwinner.net} {sentby:smtp auth 216.113.237.29 authed with dwinner@dwinner.net} 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:09:05 -0000 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 > >