On Wed, May 27, 2009 at 10:40 AM, Iustin Pop <[email protected]> wrote:
> On Wed, May 27, 2009 at 10:14:53AM +0100, Guido Trotter wrote:
>> On Tue, May 26, 2009 at 6:45 PM, Iustin Pop <[email protected]> wrote:
>> > +
>> > + �...@classmethod
>> > +  def LinuxPowercycle(cls):
>> > +    """Linux-specific powercycle method.
>> > +
>> > +    """
>> > +    fd = os.open("/proc/sysrq-trigger", os.O_WRONLY)
>>
>> Should we check that it exists before actually opening it?
>> Or catch an error in the os.open call. We can at least try to log the error.
>
> So I expect here that opening will fail, and the normal handler will log it.
>
> But good point, we can make it more explicit. I'd propose:
>  - try to open
>  - if fail:
>    - run “telinit 6”? or shutdown -r?
>

sure, this works! (no particular preference from me between those two...)

Thanks,

Guido

Reply via email to