[Pacemaker] Stonith setup hostname params

Dejan Muhamedagic dejanmm at fastmail.fm
Mon Apr 4 13:19:45 UTC 2011


On Fri, Apr 01, 2011 at 11:19:59PM +0400, Pavel Levshin wrote:
> 29.03.2011 17:28, Dejan Muhamedagic:
>
>
>> The fact that the shell has this feature doesn't mean that it
>> should be misused. It was meant mainly for one-off management
>> commands (such as "resource stop" or "node standby") and only
>> very seldom for one-off configuration commands.
>
> Sounds reasonable.
>
> If you think that the feature should not be misused, there must be  
> something enforcing your intention. Unfortunately, it's almost late to  
> restrict command line arguments usage, as it will broke backward  
> compatibility.

It shouldn't be restricted, just used judiciously.

>>> But, unfortunately, the feature is not uniform with interactive shell.
>> How's that now? I know that many people don't understand how
>> shell (as in bash) work, but don't understand how crm shell can
>> work around that. If you have an idea, please speak up.
>
> I'm not very familiar with crm shell internals, so it's raw idea only.  
> But, as I've said before, this kind of mistake can be detected. Look at  
> what we have seen in the very start of the thread:
>
> >crm configure primitive rsa-fencing stonith:external/ibmrsa params  
> hostname="alpha1 alpha2" ipaddr=192.168.75.178 userid=USR passwd=PWD  
> type=ibm op monitor interval="60s"
>
>>  The console print the ERROR message: "ERROR: rsa-fencing: parameter 
> alpha2 does not exist"
>
>
> The shell does not give you meaningful explanation of what has happened.  
> Most nonintrusive change I can imagine would be to print actual crm  
> command which has caused the error. For example:
>
> ERROR: rsa-fencing: parameter alpha2 does not exist
> The command was: configure primitive rsa-fencing stonith:external/ibmrsa  
> params hostname=alpha1 alpha2 ipaddr=192.168.75.178 userid=USR  
> passwd=PWD type=ibm op monitor interval=60s
>
>
> Hopefully the user will quickly notice the difference between his  
> command and shell's variant.
>
> The shell can also analyze command line parameters and note that one of  
> them contains space.

Hmm, how? The problem is that what you, as a human, see is not
what the computer sees. You can deduct from the context that
"alpha2" is not probably a node name. Or do you expect me to do
bring some AI into the shell?

> It would then suggest user to do proper shell  
> escaping. But there may be false positives.
>
>
> The shell can go one step further and analyze it's arguments to repair  
> lost quotes. If there are many arguments, and there is an argument  
> without quotes and with space inside, quotes can be inserted right after  
> first '=' character (if any) and at the end of the argument. The result  
> may be unreliable, though. So it's up to you to rate this quirk.

This is definitely out. It's not up to the shell to repair
user's input. In particular since it cannot be sure what the
user wanted.

Thanks,

Dejan

>
> --
> Pavel Levshin
>

> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker





More information about the Pacemaker mailing list