[OpenIndiana-discuss] zlogin question
Jim Klimov
jimklimov at cos.ru
Thu Feb 7 20:43:47 UTC 2013
Hello all,
Sometimes I need to run some common simple task on several zones,
issuing the command from global zone via 'zlogin "cmd param"' call.
The task maybe anything trivial, like "df" to test that all mounts
succeeded, or "init 5" to cause graceful shutdowns across the board.
To make many such calls, the apparent method is a shell loop:
(Yes, I could also chomp off the "global" entry - but I'm lazy enough).
# zoneadm list | while read Z ; do zlogin "$Z" "zonename"; done
And voila!? This loop exits after the first running zone...
These variations work more as expected and run for all zones:
# zoneadm list | while read Z ; do zlogin "$Z" "zonename" & wait; done
# for Z in `zoneadm list`; do zlogin "$Z" "zonename"; don
I don't see any apparent errors in the scripting side, except that
maybe zlogin somehow acts like exec and ceases the subshell?
Any ideas? Is it a bug or my mistake?
//Jim
More information about the OpenIndiana-discuss
mailing list