gharris999;507919 Wrote: 
> Yes.  If the EOD (End of Day) action is set to a custom script or if the
> EOD action is not equal to the regular idle action, then the EOD start
> time is treated as an alarm.  
> 
> Typical use case for me:  my EOD time starts at 2am, ends at 2:05, has
> the 'allowed idle time' set to 0 (zero), and has the action command set
> to run a custom script.  That script performs operating system updates,
> Squeezebox Server updates (via svn) and other chores. When the previous
> on-idle suspend occurred, the plugin set a alarm wake-up so that the
> server would wake up at 1:55 in order to "service" the EOD action.
> 
> At the end of my custom EOD action script, the server gets rebooted. 
> Because I have the 'allowed idle time' for the EOD set to 0 (zero), when
> the server restarts, the plugin "sees" that it's already within the EOD
> period and so it doesn't fire off the custom script a 2nd or 3rd time. 
> This is a special case: EOD_idle_time == 0 means that a EOD action gets
> called just once.
> 
> I will eventually tweak this behavior one more time.  The new behavior
> that I'm planning will call for the EOD watchdog to ignore the custom
> command (if present) and instead call the action selected in the EOD
> idle-action drop down list.  That will allow me to extend the EOD period
> and have the server suspend sooner after the custom script chores have
> completed.
> 
> The Idle Player Monitor and the End of Day monitor should never
> conflict.  While the plugin senses that it is "in" the EOD period, it
> just checks the EOD watchdog, and ignores the idle watchdog.

That makes sense, and fits the behaviour I've seen.  

One thing I've noticed, (and this goes back to the original problem I
had with EOD actions before I upgraded), is that if the server is
restarted during the EOD period, after the EOD action has already been
called once (Shutdown to MSB), and "allowed idle time" > 0 (10 mins),
the EOD action still gets ignored.  I'm assuming this bit in the
server.log confirms that :


Code:
--------------------
    
  [10-01-19 02:35:41.9439] 
Plugins::SrvrPowerCtrl::Watchdog::ActivateEODWatchdog (375) Skipping EOD checks 
because IsInEOD and bSkipEODCheck == 1
  
--------------------


My EOD is set as follows:

Allowed idle time : 10 mins
EOD start and end times : 10.20pm to 6.00am
Action to take : Shutdown to mysqueezebox.com
(no custom action)

I also have "Alarm interactions" switched on, to wake the server 5
minutes before any alarms, which includes EOD as discussed.

Originally (in my previous posts) I thought this was a problem related
to CLI-issued blocks not being cleared.  To explain : I have a PC
running Windows XP, the main PC for our house.  At 2.30am it boots, and
runs some maintenance tasks, and also wakes up the media server.  A
"Block" command is issued via CLI and a backup job to the server from
the PC is run, then the block is cleared.  Checking the server log, I
see that the Block is cleared:


Code:
--------------------
    
  [10-01-19 02:42:39.8618] Plugins::SrvrPowerCtrl::CLI::cliClearBlock (136) 
Attempting to clear block via CLI: caller: viacli, message: Backup_Tasks
  [10-01-19 02:42:39.8623] Plugins::SrvrPowerCtrl::Plugin::blockAction (411) 
Begin: there are 1 blockactions set.
  [10-01-19 02:42:39.8629] Plugins::SrvrPowerCtrl::Plugin::blockAction (484) 
Deleting blockAction[0] caller: viacli, reason: Backup_Tasks
  
--------------------


I had hoped what would then happen is SPC's EOD would kick in again. 
After 10 mins of inactivity, it would shutdown the server, and push the
players to MSB.com.  However, this does not happen, and fits the
behaviour you describe for when the EOD Idle time is set to zero (not 10
mins as in this case).

Having read your description of EOD, the next step you are intending
for EOD could fix that.  Could you provide an option such that I can
decide whether EOD actions should fire once, or fire multiple times,
during the start/end period?

Alternatively, I can simply shutdown the PC remotely, with SPC set to
push players to SBC on external shutdown event.

This leads to a second problem I've come across, which may well be a
bug, and that is related to the Idle Player Monitor and alarms. 

I have Idle player monitor switched on, and had this set to 15 minutes,
with the action to suspend the server.  Also, recall that I have the EOD
period set from 10.20pm to 6.00am.  The server (as described above) did
not shutdown during the EOD period.  At 6am the Idle monitor cut in, and
15 minutes later the server was suspended...just as you'd expect.

I have an alarm scheduled to go off at 7.05am.  Thanks to RTC wakeup
being set by SPC, the server woke-up at 6.55am, again as expected.  What
then happened was that the alarm went off, I put it into snooze after 10
seconds or so, and then Idle Player Monitor turned off the server a few
minutes later, preventing the alarm going off any more.  A check in the
server log confirms this (although it doesn't show any entries for the
alarm going off, I assume this is because I haven't set logging for
this, only for SPC):


Code:
--------------------
    
  [10-01-19 06:55:16.8154] Plugins::SrvrPowerCtrl::Util::SystemExecCmd (848) 
Command: "sudo /usr/sbin/pm-suspend" returned 0
  [10-01-19 06:55:18.0040] Plugins::SrvrPowerCtrl::SleepButton::mapKeyHold 
(239) mapping sleep.hold to 
modefunction_PLUGIN.SrvrPowerCtrl::Plugin->ourSleepHoldButtonHandler for 
Squeezebox::boom::10::'Boom' in 1 modes.
  [10-01-19 06:55:54.2138] Plugins::SrvrPowerCtrl::Watchdog::OnWakeupWatchdog 
(518) Wakeup Call!!
  [10-01-19 06:55:54.2186] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 14 minutes left in the idle countdown..
  [10-01-19 06:56:09.0007] Plugins::SrvrPowerCtrl::Util::PullFromSqueezeNetwork 
(1072) SBS reports get_server('sn') == www.mysqueezebox.com
  [10-01-19 06:56:09.0015] Plugins::SrvrPowerCtrl::Util::GetSNPlayers (1045) 0 
players connected to www.mysqueezebox.com
  [10-01-19 06:56:09.0021] Plugins::SrvrPowerCtrl::Util::PullFromSqueezeNetwork 
(1100) No players to restore..
  [10-01-19 06:56:54.0040] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 13 minutes left in the idle countdown..
  [10-01-19 06:57:54.0040] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 12 minutes left in the idle countdown..
  [10-01-19 06:58:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 11 minutes left in the idle countdown..
  [10-01-19 06:59:54.0041] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 10 minutes left in the idle countdown..
  [10-01-19 07:00:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 9 minutes left in the idle countdown..
  [10-01-19 07:01:54.0041] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 8 minutes left in the idle countdown..
  [10-01-19 07:02:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 7 minutes left in the idle countdown..
  [10-01-19 07:03:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 6 minutes left in the idle countdown..
  [10-01-19 07:04:54.0041] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 5 minutes left in the idle countdown..
  [10-01-19 07:05:54.0041] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 4 minutes left in the idle countdown..
  [10-01-19 07:06:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 3 minutes left in the idle countdown..
  [10-01-19 07:07:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 2 minutes left in the idle countdown..
  [10-01-19 07:08:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (254) 
Players are idle: 1 minutes left in the idle countdown..
  [10-01-19 07:09:54.0042] Plugins::SrvrPowerCtrl::Watchdog::IdleWatchdog (262) 
Players are idle and idle timeout of 15 has elapsed..
  [10-01-19 07:09:54.0051] Plugins::SrvrPowerCtrl::Watchdog::CueWatchdogAction 
(113) Timer # EV::Timer=SCALAR(0xc8ab548) created.  Action suspend is pending 
in 5 seconds..
  
--------------------


It seems as soon as the server wokeup, the idle monitor started
counting down the minutes, even though the alarm on my Boom went off,
and started playing the radio during that time.  Could it be that the
alarm wasn't allowed to play for long enough for the idle monitor to
catch it? 

(sorry for such a long post,  I wanted to provide as much information
as possible).

Chris.


-- 
chris.mason
------------------------------------------------------------------------
chris.mason's Profile: http://forums.slimdevices.com/member.php?userid=3323
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to