.bash_logout and shutdown -- need ideas
Andrew Gould
andrewgould at yahoo.com
Fri Aug 4 17:01:44 UTC 2006
--- DW <spock at 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'?
Andrew L. Gould
More information about the freebsd-questions
mailing list