In the case of multiple exports and/or imports in /etc/gnbdtab, the exports and/or imports are bundled together on one command line when exporting/importing, causing the respective command (gnbd_export/gnbd_import) to choke. Reproducible: Always Steps to Reproduce: 1. Add more than one import/export in /etc/gnbdtab 2. Start /etc/init.d/gnbd-client and/or /etc/init.d/gnbd-srv Actual Results: Error message from script: gnbd_import: ERROR flags -i and -i are not compatible or similar from gnbd_export Expected Results: The command lines should be parsed and served to gnbd_export/gnbd_import one line at a time.
Created attachment 70054 [details, diff] Patch to enable gnbd-srv to manage multiple exports
Created attachment 70055 [details, diff] Patch to enable gnbd-client to manage multiple imports
Comment on attachment 70054 [details, diff] Patch to enable gnbd-srv to manage multiple exports --- gnbd-srv.broken 2005-10-07 10:48:33.000000000 +0200 +++ gnbd-srv 2005-10-07 10:05:17.000000000 +0200 @@ -32,7 +32,7 @@ if [ -n "$GNBD" ] ; then ebegin "Exporting all GNBDs devices" einfo "$(awk '/^export/ { print "--> device:", $4, "as", $3 }' /etc/gnbdtab )" - cat /etc/gnbdtab | awk '/^export/ { print "-d", $4, "-e", $3 }' | xargs gnbd_export > /dev/null + cat /etc/gnbdtab | awk '/^export/ { print "-d", $4, "-e", $3 }' | xargs -l gnbd_export -c > /dev/null eend $? "Failed to export gnbd devices" fi }
Comment on attachment 70055 [details, diff] Patch to enable gnbd-client to manage multiple imports --- gnbd-client.broken 2005-10-07 10:48:10.000000000 +0200 +++ gnbd-client 2005-10-07 10:07:32.000000000 +0200 @@ -45,7 +45,7 @@ if [ -n "$GNBD" ] ; then ebegin "Importing all GNBDs devices" einfo "$(awk '/^import/ { print "--> server:", $2 }' /etc/gnbdtab )" - cat /etc/gnbdtab | awk '/^import/ { print "-i", $2 }' | xargs gnbd_import > /dev/null + cat /etc/gnbdtab | awk '/^import/ { print "-i", $2 }' | xargs -l gnbd_import > /dev/null eend $? "Failed to import gnbd devices" fi }
fixed gnbdtab in CVS. I've also added two external conf files to set import/export options. The suggested -c flag is wrong in many cases (have a look to the man page).