Re: .bash_logout and shutdown -- need ideas

2006-08-05 Thread Ian Smith
On Fri, 4 Aug 2006 [EMAIL PROTECTED] wrote:

 > Message: 5
 > Date: Fri, 04 Aug 2006 19:38:12 +0200
 > From: Svein Halvor Halvorsen <[EMAIL PROTECTED]>
 > Subject: Re: .bash_logout and shutdown -- need ideas
 > To: DW <[EMAIL PROTECTED]>
 > Cc: freebsd-questions@freebsd.org
 > Message-ID: <[EMAIL PROTECTED]>
 > Content-Type: text/plain; charset="iso-8859-1"
 > 
 > DW wrote:
 > > Just started using a .bash_logout script to handle doing my unison
 > :
 > > 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?
 > 
 > 
 > At shutdown FreeBSD runs /etc/rc.shutdown. It seems that this script, by
 > means of /etc/rc.subr, will iterate all the files in (among others)
 > /usr/local/etc/rc.d/ and call them with the "faststop" argument.
 > 
 > Maybe you could just add a script in there?
 > 
 > (Actually, only files with a "# PROVIDES" line are considered, it seems,
 > so you should think about that).

Also, DW was running 'sudo shutdown -p now' which is indeed immediate .. 
'shutdown -p +1' (say) sets the shutdown countdown to one minute, makes
(w)all sorts of noise then and again at (as I recall) 30 seconds to
zero, plenty of time to logout from other things and (auto)run any other
scripts you like before the shutdown-initiated rc.shutdown stuff. 

Furthermore, if you change your mind you've got time to kill shutdown
itself before the timeout.  'sudo killall shutdown' should do the trick.

Cheers, Ian

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: .bash_logout and shutdown -- need ideas

2006-08-04 Thread Svein Halvor Halvorsen
DW wrote:
> Just started using a .bash_logout script to handle doing my unison
:
> 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?


At shutdown FreeBSD runs /etc/rc.shutdown. It seems that this script, by
means of /etc/rc.subr, will iterate all the files in (among others)
/usr/local/etc/rc.d/ and call them with the "faststop" argument.

Maybe you could just add a script in there?

(Actually, only files with a "# PROVIDES" line are considered, it seems,
so you should think about that).


Svein Halvor



signature.asc
Description: OpenPGP digital signature


Re: .bash_logout and shutdown -- need ideas

2006-08-04 Thread Andrew Gould
--- DW <[EMAIL PROTECTED]> wrote:

> Andrew Gould wrote:
> > --- DW <[EMAIL PROTECTED]> 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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: .bash_logout and shutdown -- need ideas

2006-08-04 Thread DW

Andrew Gould wrote:

--- DW <[EMAIL PROTECTED]> 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

  


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: .bash_logout and shutdown -- need ideas

2006-08-04 Thread Andrew Gould
--- DW <[EMAIL PROTECTED]> 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

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"