On Tue, Jun 17, 2008 at 10:34 AM, Dejan Muhamedagic <[EMAIL PROTECTED]> wrote:
> Hi Dominik,
>
> On Tue, Jun 17, 2008 at 11:28:17AM +0200, Dominik Klein wrote:
>> Hi
>>
>> I wrote an RA, which can start virtually anything in a very basic meaning.
>
> An interesting idea :)
>
>> You can configure
>> * binfile
>> * cmdline_options
>> * logfile
>> * errlogfile
>> * user
>>
>> Names should be self-explaining I guess.
>>
>> The RA starts the command configured with $binfile and $cmdline_options
>> as $user and redirects stdout and stderr to appropriate files.
>
> This may not be necessary. Whatever comes out on stdout/stderr
> will be logged by lrmd.
>
>> It stops the command with kill. If kill does not work, it uses kill -9.
>
> I guess that you mean kill without options which translates to
> kill -TERM.
>
>> Monitors are done with ps. No deep check here but a pointer where to
>> implement that if needed.
>
> Perhaps implement a monitor script hook, such as the one in Xen.
> That way one keeps the RA intact.

It would be good to have one more optional parameter: monitor_script.
In this case user would be able to provide his own monitor and that
would create more flexibility.

>>
>> anything_stop() {
>>       if anything_status
>>       then
>>               tries=5
>>               i=0
>>               while [ $i -lt $tries ]
>>               do
>>                       # there may be programs without command line options
>>                       [ -n "$cmdline_options" ] && cmd="$binfile 
>> $cmdline_options" || cmd="$binfile"
>>                       pkill -u $user -f "$cmd"

I personally don't like the idea of relying on the fact that binfile
will start a process with the same name. One could have a custom
script for starting a process with other name. On other hand one could
also have several processes with the same name.



-- 
Serge Dubrouski.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to