mrw;594404 Wrote:
> Not quite. You can force the system to sleep manually. (Apple menu item,
> 'Sleep'). This will override any 'NoSleep' assertions in force.
> An alternative approach might be to catch the system has woken event,
> and end at that point.
> Agree doesn't seem to be a biggie.
> Have the tool write out its PID to a known file and have SBS kill it
> from that ?
> Alternatively have SBS execute the tool through a script, and let the
> script handle the killing of an existing instance. Not unlike a system
> daemon start-up script.
> I haven't examined how SBS launches the tool.
>
> Example: SleepWatcher will write out its PID if asked - I have used
> that for a similar purpose in the past.
> Thanks. I'll explore this further in the New Year. I think I did pick
> up on the sudoers configuration.
I incorporated all your suggestions last night and committed them to
the beta repo. Thanks for the ideas!
I think I've managed to produce a universal binary. But I have no
access to a ppc machine to see if it runs on 10.5. Anyway, it works on
my intel mac-mini. Do let me know if you try it and it fails on your
ppc machine.
I created a _killInhibitCmd function in the plugin that attempts to
kill gsession-inhibit or sleep-inhibit on either resume or plugin
shutdown (i.e., when SBS itself shuts down). That ought to solve both
the "orphaned sleep-inhibit" problem that you pointed out and the "how
to update the plugin" problem I was speculating about.
I'm just doing a system call to killall. On OSX, since SBS runs under
a user account, this is straight forward. On linux/gnome, however,
while SBS runs under the 'squeezeboxserver' account, gsession-inhibit
runs under the account of the user logged into gdm. This requires
/etc/sudoers entries to both allow squeezeboxserver to run
gsession-inhibit as another user and to kill gsession-inhibit as that
other user. E.g.:
Code:
--------------------
squeezeboxserver ALL = (ALL) NOPASSWD:
/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/ReallyPreventStandby/bin/unix/gsession-inhibit*
squeezeboxserver ALL = (ALL) NOPASSWD: /usr/bin/killall -9 gsession-inhibit
--------------------
I keep seeing warnings in various killall documentation that one has to
be careful with the command as you can end up killing more than you
intend.
On OSX, I'm doing a simple:
# killall -9 sleep-inhibit
On gnome, it's:
# sudo -u $gnome_user killall -9 sleep-inhibit
Anyone see a problem with this approach? I'm sure there must be a more
elegant and sure solution.
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins