Export to GitHub

pdsh - issue #17

dshgroup module include statements


Posted on Apr 14, 2011 by Grumpy Bird

Is there any way to have an include statement in a the dsh module group file so updating a machine in one file will effect the rest, like:

GROUP1 servera serverb

GROUP2 clienta clientb

GROUP.ALL {include GROUP1} {include GROUP2}

We have multiple locations and this would be an excellent feature. I would be willing to test any code on RHEL5 or HP-UX 11.23/11.31 or freeBSD.

Thanks,

Sean

Comment #1

Posted on Apr 14, 2011 by Happy Ox

This seems like a great feature, however the dshgroup module is meant to be compatible with Junichi Uekawa's dsh (Dancer's Shell)

http://www.netfort.gr.jp/~dancer/software/dsh.html.en

and I don't think the version of dsh group files in that code supports 'include' style statements.

However, since group files written for dsh would still work with pdsh even after extra features are added (it just won't work the other way around) perhaps this is ok. Let me think on it for a bit.

Another option is that you could try using genders, which is much more flexible. You have all your hosts in one file, and hosts can be assigned multiple attributes (with optional values).

https://computing.llnl.gov/linux/genders.html

Comment #2

Posted on Aug 8, 2011 by Helpful Kangaroo

Does dsh allow for comments? If so, perhaps you could do the following:

include myGroupFile

include /etc/dsh/group/systemGroupFile

This would give you the ability to parse for additional files to include while allowing dsh to ignore them.

Scott

Comment #3

Posted on Aug 8, 2011 by Happy Ox

That is a good idea if there is still interest in having dshgroup files support an include statement. I think the original person that opened this bug found that genders was a good solution.

Comment #4

Posted on Aug 10, 2011 by Helpful Kangaroo

I am certainly interested in the ability to have include statements, though I may be in the minority.

Comment #5

Posted on Aug 10, 2011 by Happy Ox

Ok, I will see if I can get this into the next release.

Comment #6

Posted on Aug 10, 2011 by Helpful Kangaroo

If you need any assistance in testing it, let me know. I have access to HP-UX, SLES, RHEL, and Mac OS X (10.6).

Comment #7

Posted on Aug 12, 2011 by Happy Ox

This issue was closed by revision r1352.

Comment #8

Posted on Aug 12, 2011 by Happy Ox

Ok, I've committed the changes to the trunk in r1325 (as you can see above). I added some simple tests to the testsuite, so if you have time to test, please do! I would love to know how the testsuite does on HP-UX as well (make check).

Thanks! mark

Comment #9

Posted on Aug 14, 2011 by Helpful Kangaroo

Hi Mark,

The test on the Mac went well. HP-UX, however, croaked during the link as strsep does not exist. I swapped strsep for strtok, which allowed gmake to complete without errors (though there were a few warnings here and there). I have yet to get everything to work, as the version of pdsh that ships with HP-UX's DSAUtilities package (version 2.16) includes a modified mod.c and dshbak (if you want to see these files, I can forward them to you).

I'll have more time next week to work on this, but wanted to get you an update.

Scott

Comment #10

Posted on Aug 14, 2011 by Helpful Kangaroo

Comment deleted

Comment #11

Posted on Aug 15, 2011 by Happy Ox

Wow, thanks for doing all the testing! Sorry, I used strsep() without thinking, thanks for pointing out the fix. I'll make the same change you did, or maybe try to reuse some code (already have list_split() to split a line on arbitrary characters, so I'm not sure why I used something different)

Is it ok to open a separate issue for the HP-UX issues?

Comment #12

Posted on Aug 15, 2011 by Helpful Kangaroo

It's ok with me.

Comment #13

Posted on Aug 19, 2011 by Happy Ox

This issue was updated by revision r1357.

Use strtok instead of strsep when reading wcoll file for portability. Thanks to for the suggested change.

Status: Fixed

Labels:
Type-Enhancement Priority-Medium