Wirrunna;406033 Wrote: 
> Stuart,
> I have both Lazy Search and Server Power Control installed and suspect
> that Server Power Control shuts down my server before the lazification
> process has finished if I kick off a "clear and rescan everything"
> before going to bed at night.
> The Server Power Control plugin monitors the server activity and shuts
> it down after a configurable period of idleness.
> Now, I could lengthen the idle period, but I suggest that the better
> way will be for the lazification process to tell Server Power Control
> that its still lazifying the database.
> I'll post in the Server Power Control thread and hopefully you and
> Gordon can sort this out.
Cross posting for Stuart's benefit:

Any plugin can set and clear SrvrPowerCtrl blocks via the CLI without
having to worry about whether SrvrPowerCtrl is installed or not.  If
SrvrPowerCtrl isn't there, the cli call is harmless and does nothing.

E.G.

Code:
--------------------
    
  #Prevent untimely suspends, etc.. 
  my $blockOwner = 'LazySearch';
  my $blockReason = 'Performing_Lazifacation';
  my $blockcode = $client->execute(['srvrpowerctrl', 'setblock', $blockReason, 
$blockOwner]);
  
  #my long running process...
  #...
  #...
  
  #Unblock suspends, etc...
  $client->execute(['srvrpowerctrl', 'clearblock', $blockcode, $blockOwner]);
  
--------------------


-- alternately, a stateless implementation:


Code:
--------------------
    
  #Prevent untimely suspends, etc.. 
  $client->execute(['srvrpowerctrl', 'setblock', 'reason_for_blocking', 
'viacli']);
  
  #my long running process...
  #...
  #...
  
  #Unblock suspends, etc...
  $client->execute(['srvrpowerctrl', 'clearblock', 'reason_for_unblocking', 
'viacli']);
  
--------------------


Wrapping a long-ish process in those set block & clear block cli
requests will prevent SrvrPowerCtrl from interrupting a process by
shutting down / suspending / etc.  The calls have the added benefit
that, if SrvrPowerCtrl IS installed, the
"reason_for_blocking/unblocking" messages get displayed briefly on all
clients.


-- 
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=45531

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

Reply via email to