Mailing List Archive

[PATCH] Power control
Hi.

About 1-2 years ago I fond a nice looking patch[1] for power control via
conserver on this maillist.

I have done some cleanup work and some fixes to get it more usable, and
its currently working pretty nice.

I would love to get this functionality included in mainline.

The patch is available on:

http://www.acc.umu.se/~glance/conserver/conserver-8.1.17-power-control.patch

And some examples on how we are using the power control stuff is
available at http://www.acc.umu.se/~glance/conserver/conserver.cf

//Anton

1. https://www.conserver.com/pipermail/users/2007-June/msg00018.html

--
Anton Lundin +46702-161604
Re: [PATCH] Power control [ In reply to ]
Hi,

On Fri, Oct 29, 2010 at 03:44:00PM +0200, Anton Lundin wrote:
> About 1-2 years ago I fond a nice looking patch[1] for power control via
> conserver on this maillist.

Interesting patch. IMHO, it would be more useful to allow for generic commands.
Your need may be power control. Someone else's may be e.g. "output event
log" etc.

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: [PATCH] Power control [ In reply to ]
On 11/02/2010 05:29 AM, Fabien Wernli wrote:
> Hi,
>
> On Fri, Oct 29, 2010 at 03:44:00PM +0200, Anton Lundin wrote:
>
>> About 1-2 years ago I fond a nice looking patch[1] for power control via
>> conserver on this maillist.
>>
> Interesting patch. IMHO, it would be more useful to allow for generic commands.
> Your need may be power control. Someone else's may be e.g. "output event
> log" etc.
>
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
>

It does allow for generic commands. Maybe the labelling of the options
should come from the config file? If you really want this then how
about a patch? ;-)
_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: [PATCH] Power control [ In reply to ]
On 02 November, 2010 - Bill Peck wrote:

> On 11/02/2010 05:29 AM, Fabien Wernli wrote:
>> Hi,
>>
>> On Fri, Oct 29, 2010 at 03:44:00PM +0200, Anton Lundin wrote:
>>
>>> About 1-2 years ago I fond a nice looking patch[1] for power control via
>>> conserver on this maillist.
>>>
>> Interesting patch. IMHO, it would be more useful to allow for generic commands.
>> Your need may be power control. Someone else's may be e.g. "output event
>> log" etc.
>>
>
> It does allow for generic commands. Maybe the labelling of the options
> should come from the config file? If you really want this then how
> about a patch? ;-)

Its a trivial rewrite of the patch to call them something else, so if
that would get the code upstream I could do it.

//Anton

--
Anton Lundin +46702-161604
Re: [PATCH] Power control [ In reply to ]
On Fri, Oct 29, 2010 at 6:44 AM, Anton Lundin <glance@acc.umu.se> wrote:

> Hi.
>
> About 1-2 years ago I fond a nice looking patch[1] for power control via
> conserver on this maillist.
>
> I have done some cleanup work and some fixes to get it more usable, and
> its currently working pretty nice.
>
> I would love to get this functionality included in mainline.
>
> The patch is available on:
>
>
> http://www.acc.umu.se/~glance/conserver/conserver-8.1.17-power-control.patch<http://www.acc.umu.se/%7Eglance/conserver/conserver-8.1.17-power-control.patch>
>
> And some examples on how we are using the power control stuff is
> available at http://www.acc.umu.se/~glance/conserver/conserver.cf<http://www.acc.umu.se/%7Eglance/conserver/conserver.cf>
>
>
Direct IPMI / iLO support in conserver would be a huge plus. About half of
my consoles now are iLO VSPs glued together with expect scripts.

iLO3 is a PITA to get working with conserver as it is now.

-Bruce



> //Anton
>
> 1. https://www.conserver.com/pipermail/users/2007-June/msg00018.html
>
> --
> Anton Lundin +46702-161604
>
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
>
>
Re: [PATCH] Power control [ In reply to ]
I've been looking at the patch, and I do want to integrate it in. It's going to take a little work, however. The current implementation can block the conserver process if the exec'ed script fails to behave nicely (and no matter the whole process will stop, waiting for it to complete). That really needs to be adjusted so it won't block...and can still service other consoles intermixed with the one running the command. And an ability to stop it, in case it does go bad.

And I'm all for making it more generic as well...perhaps by making the 'k' command programmable - in the sense that you can associate a command with any character ([a-z0-9]) after 'k' and give it a label so you know what the command is supposed to do.

So, 'k' for 'k'ommand...or perhaps even '!' to invoke a command? Harder to type, but consistent with vi, for example.

Any feedback appreciated...

Bryan

On Nov 2, 2010, at 8:43 AM, Anton Lundin wrote:

> On 02 November, 2010 - Bill Peck wrote:
>
>> On 11/02/2010 05:29 AM, Fabien Wernli wrote:
>>> Hi,
>>>
>>> On Fri, Oct 29, 2010 at 03:44:00PM +0200, Anton Lundin wrote:
>>>
>>>> About 1-2 years ago I fond a nice looking patch[1] for power control via
>>>> conserver on this maillist.
>>>>
>>> Interesting patch. IMHO, it would be more useful to allow for generic commands.
>>> Your need may be power control. Someone else's may be e.g. "output event
>>> log" etc.
>>>
>>
>> It does allow for generic commands. Maybe the labelling of the options
>> should come from the config file? If you really want this then how
>> about a patch? ;-)
>
> Its a trivial rewrite of the patch to call them something else, so if
> that would get the code upstream I could do it.
>
> //Anton
>
> --
> Anton Lundin +46702-161604
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users


_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: [PATCH] Power control [ In reply to ]
On Wed, 2010-11-03 at 14:43 -0700, Bryan Stansell wrote:
>
> Any feedback appreciated...

I did this back in 7.2.7 for our application.

I wrote a program that would mange the power strips. It supported
different scripts using the chat library to control them. I then wrote
an API that used IPC to instruct this program on what to do.

There were two commands. On and Off. Note, reboot is off then on.
There were two arguments. Strip # and outlet #. If you wanted to power
off the 7th outlet on the first strip you would send off,1,7. Conserver
would then use IPC to send the command to the program which then
interfaced with the strip.

The beauty of this system is that outside of conserver, on the CLI of
Linux, we have 3 commands. On, off, and reboot. Those are the only 3
commands supported. If you have a Spectrum, Baytech, or APC you still
used those 3 commands. The power management program dealt with the
issues of interfacing with the strip.

I modified conserver and added 'O' and 'N' options.

Chris


_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Re: [PATCH] Power control [ In reply to ]
On Wed, Nov 03, 2010 at 02:43:46PM -0700, Bryan Stansell wrote:
> And I'm all for making it more generic as well...perhaps by making the 'k' command programmable - in the sense that you can associate a command with any character ([a-z0-9]) after 'k' and give it a label so you know what the command is supposed to do.
>
> So, 'k' for 'k'ommand...or perhaps even '!' to invoke a command? Harder to type, but consistent with vi, for example.

Great. I vote for '!'.
Also, maybe it would be interesting to have a distinction between commands
that output something or not on std(err|out).

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: [PATCH] Power control [ In reply to ]
There is certainly going to be a need to either redirect stdin/stdout of the command to the console or not (some "interactive" flag). If not, stdin would probably be /dev/null and stdout could be anyone connected to the console (so everyone sees the output). Maybe it should just be the console or nothing at all. Something to think about...

Bryan

On Nov 4, 2010, at 2:01 AM, Fabien Wernli wrote:

> On Wed, Nov 03, 2010 at 02:43:46PM -0700, Bryan Stansell wrote:
>> And I'm all for making it more generic as well...perhaps by making the 'k' command programmable - in the sense that you can associate a command with any character ([a-z0-9]) after 'k' and give it a label so you know what the command is supposed to do.
>>
>> So, 'k' for 'k'ommand...or perhaps even '!' to invoke a command? Harder to type, but consistent with vi, for example.
>
> Great. I vote for '!'.
> Also, maybe it would be interesting to have a distinction between commands
> that output something or not on std(err|out).
>
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users


_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: [PATCH] Power control [ In reply to ]
Second generation of this patch, done.

http://www.acc.umu.se/~glance/conserver/02-conserver-8.1.18-power-control.patch

Fixed the "multiplexing" so that the powercmd can't hang the whole
Kiddie()-process. Its pretty much the same as its done for initcmd's.

There is probably still some fiddeling to be done before its perfect<tm>
but its god enuff to take a look at.

Things on the todo:
* processgroup for the powercmd like its done for initcmd's?
* stdin for powercmd? currently its just close()'d
* put the output from the powercmd in the log?
* kill hanging powercmd's after $foo seconds?
* maybee rename everything to ServerSite-kommands?

//Anton - Who is heading home to end this year with a big bang...

On 04 November, 2010 - Bryan Stansell wrote:

> There is certainly going to be a need to either redirect stdin/stdout of the command to the console or not (some "interactive" flag). If not, stdin would probably be /dev/null and stdout could be anyone connected to the console (so everyone sees the output). Maybe it should just be the console or nothing at all. Something to think about...
>
> Bryan
>
> On Nov 4, 2010, at 2:01 AM, Fabien Wernli wrote:
>
> > On Wed, Nov 03, 2010 at 02:43:46PM -0700, Bryan Stansell wrote:
> >> And I'm all for making it more generic as well...perhaps by making the 'k' command programmable - in the sense that you can associate a command with any character ([a-z0-9]) after 'k' and give it a label so you know what the command is supposed to do.
> >>
> >> So, 'k' for 'k'ommand...or perhaps even '!' to invoke a command? Harder to type, but consistent with vi, for example.
> >
> > Great. I vote for '!'.
> > Also, maybe it would be interesting to have a distinction between commands
> > that output something or not on std(err|out).
> >
> > _______________________________________________
> > users mailing list
> > users@conserver.com
> > https://www.conserver.com/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users

--
Anton Lundin +46702-161604
Re: [PATCH] Power control [ In reply to ]
Allmost 2 months and zero feedback. Thus its perfect? =)

//Anton

On 30 December, 2010 - Anton Lundin wrote:

> Second generation of this patch, done.
>
> http://www.acc.umu.se/~glance/conserver/02-conserver-8.1.18-power-control.patch
>
> Fixed the "multiplexing" so that the powercmd can't hang the whole
> Kiddie()-process. Its pretty much the same as its done for initcmd's.
>
> There is probably still some fiddeling to be done before its perfect<tm>
> but its god enuff to take a look at.
>
> Things on the todo:
> * processgroup for the powercmd like its done for initcmd's?
> * stdin for powercmd? currently its just close()'d
> * put the output from the powercmd in the log?
> * kill hanging powercmd's after $foo seconds?
> * maybee rename everything to ServerSite-kommands?
>
> //Anton - Who is heading home to end this year with a big bang...
>
> On 04 November, 2010 - Bryan Stansell wrote:
>
> > There is certainly going to be a need to either redirect stdin/stdout of the command to the console or not (some "interactive" flag). If not, stdin would probably be /dev/null and stdout could be anyone connected to the console (so everyone sees the output). Maybe it should just be the console or nothing at all. Something to think about...
> >
> > Bryan
> >
> > On Nov 4, 2010, at 2:01 AM, Fabien Wernli wrote:
> >
> > > On Wed, Nov 03, 2010 at 02:43:46PM -0700, Bryan Stansell wrote:
> > >> And I'm all for making it more generic as well...perhaps by making the 'k' command programmable - in the sense that you can associate a command with any character ([a-z0-9]) after 'k' and give it a label so you know what the command is supposed to do.
> > >>
> > >> So, 'k' for 'k'ommand...or perhaps even '!' to invoke a command? Harder to type, but consistent with vi, for example.
> > >
> > > Great. I vote for '!'.
> > > Also, maybe it would be interesting to have a distinction between commands
> > > that output something or not on std(err|out).
> > >
> > > _______________________________________________
> > > users mailing list
> > > users@conserver.com
> > > https://www.conserver.com/mailman/listinfo/users
> >
> >
> > _______________________________________________
> > users mailing list
> > users@conserver.com
> > https://www.conserver.com/mailman/listinfo/users
>
> --
> Anton Lundin +46702-161604



> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users


--
Anton Lundin +46702-161604
_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users