Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
/ 2007-02-19 14:24:22 +0100 \ Lars Ellenberg: > / 2007-02-19 13:00:42 +0100 > \ Lars Marowsky-Bree: > > Hi, > > > > I've succeeded at making drbd work as a master-slave resource in > > heartbeat v2 now. So far, so good. > > > > However, drbdadm makes it exceptionally hard and annoying to parse its > > output, which means I end up having to filter and post-process it > > heavily, none of which is going to make it very easy to maintain the > > scripts. > > > > - The header printed when __DRBD_NODE__ is found in the environment is > > totally useless. > > > > - When asking drbdadm about the state of a resource not listed locally, > > it prints warnings about the other resources. That's very annoying: > > > > # drbdadm state r1 ; echo $? > > > > /etc/drbd.conf:118: in resource r0, on node_0 { ... } ... on node_1 { > > ... }: > > There are multiple host sections for the peer. > > Maybe misspelled local host name 'xen-1'? > > /etc/drbd.conf:1: in resource r0: > > missing section 'on xen-1 { ... }'. > > 10 > > > > _Yes_, I know, because __DRBD_NODE__ is not going to be set here, > > because I'm asking about a different resource! > > I want drbdadm to warn you about possible typos. > otherwise we'd get tons of complaints about it not working, > because someone mistyped a hostname. > > you should not use drbd.conf for resources that are not relevant for the > node it is on. you should not use one identical drbd.conf for 8 hosts. > > did you know that drbdadm even takes a configuration file as argument? > > > - Even when this works, I get > > > > xen-1:~ # __DRBD_NODE__=node_0 drbdadm state r1 ; echo $? > > > > found __DRBD_NODE__ in environment > > PRETENDING that I am >>node_0<< > > > > 'r1' not defined in your config. > > > > wouldn't it be more consistent if this consisted of a single "Not > > defined"? > > this "feature" is undocumented and intended primarily for being able to > syntax check the drbd.conf attached to support requests on my local work > station. > > > - When the drbd module is not loaded, I get back a warning and exit code > > 20, shouldn't this be an "Not loaded"/"Not configured" as well? > > I don't know? should it? > > > - drbdadm doesn't propagate back error codes. Even when drbdsetup fails > > (drbdadm primary, for example), it still exits with 0 - success. > > > > ioctl(,SET_STATE,) failed: Permission denied > > Partner is already primary > > Command '/sbin/drbd setup /dev/drbd0 primary' terminated with exit code 20 > > drbdadm aborting > > rc=0 > > interessting. > this is a valid bug report then. no, it is not. I just verified it here, and it works for me. the relevant code snipplet is if( (rv=cmd->function(res,cmd->name)) >= 20 ) { fprintf(stderr,"drbdadm aborting\n"); exit(rv); } so maybe something in your wrapper script is wrong? -- : Lars Ellenberg Tel +43-1-8178292-0 : : LINBIT Information Technologies GmbH Fax +43-1-8178292-82 : : Vivenotgasse 48, A-1120 Vienna/Europe http://www.linbit.com : __ please use the "List-Reply" function of your email client.