Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Commands executed in connection with timers



Rainer Zocholl wrote:
> 
> Klaus.Schmidinger@cadsoft.de(Klaus Schmidinger)  17.09.01 23:33
> 
> Once upon a time Klaus Schmidinger shaped the electrons to say...
> 
> >> But what's with VDR?
> >>
> >> The elegant solution would be a "w"+"awk" in the power down script
> >> and see if anyone is logged on and how long he is idle.
> >>
> >> Does VDR accept/survive/check a return from power down script
> >> and retrigger the "User idle"?
> 
> >I'm afraid I have no idea what you are talking about.
> >What does a system shutdown have to do with VDR calling the
> >"shutdown" script? VDR calls its shutdown script when _it_
> >wants to shutdown the system.
> 
> Yes.
> 
> >If, for whatever reason, somebody
> >else shuts down the system,
> >he will have to boot it up again by himself.
> 
> Of cause.  (That's an other point why one "wishes"
> to turn off the PC only via VDR: That the wake-up timer
> will be set. But this was not my question.)
> 
> I was only talking about the power down script VDR calls,
> no other scripts.
> VDR can't prevent nobody from pressing the poweroff key,
> but VDR might be prevented pressing "the key",
> because the user activity is now on the keyboard, not the RC.
> VDR can't check this(of cause). But the special
> power down script VDR calls may be able to check.
> 
> VDR decides:
> No events in the next 8h, No remote control keys since one hour:
> So: VDR calls the powerdown script.
> Curently this script just do
> "halt -p" or "powerdown" or "shutdown now".
> This causes the broadcast message to be sent,
> that the system shut's down now.
> 
> Sometimes sombody may be logged on and is
> working on something on the linux box.
> 
> Just after editting 1h in vi (without "write" :-))
> it's not nice to be interrupted by a power down
> initiated by VDR.
> VDR can't know what else is on the PC.
> 
> So the idea was to extend the powerdown script VDR calls.
> That script should check if VDR is allowed to shut down
> now. For example by doing a "who is longed on now".
> If some one is working (has no "idle" time) the power down script
> should of cause not shut down now, and it makes sense
> that VDR stays running (Who knows how long the user will
> continue to type...;-) And how the wake-up time will be set...)...
> 
> ---
> 
> What is the state of VDR when calling poweroff
> and poweroff simply returns?
> 
> Did VDR already clean up everyting when calling the pwd-script?
> (So the script has to restart VDR immediately)
> Or will it clean up and terminate VDR if the powerscript
> just returns?
> But there must be a way to prevent VDR calling the powerscript
> in a loop.

Well, no offense, but sometimes I really ask myself why I spend valuable
time in writing documentation, if nobody cares to read it...

See VDR/INSTALL:

  Automatic shutdown:
  -------------------

  "...Your program must
  also initiate the actual shutdown procedure of the computer. After this
  your program should return to VDR. VDR will not automatically exit after
  calling the shutdown program, but will rather continue normally until it
  receives a SIGTERM when the computer is actually shut down. So in case
  the shutdown fails, or the shutdown program for some reason decides not to
  perform a shutdown, VDR will stay up and running."

So what you want to do is possible, just don't initiate the shutdown if
somebody is still working, and return to VDR. VDR will not call the shutdown
program again before another MinUserInactivity time has passed.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________



Home | Main Index | Thread Index