Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 108360 - Current gnbd-srv and gnbd-client scripts do not handle multiple imports/exports
Summary: Current gnbd-srv and gnbd-client scripts do not handle multiple imports/exports
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-07 01:18 UTC by Jan Bruvoll
Modified: 2010-09-10 19:00 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to enable gnbd-srv to manage multiple exports (gnbd-srv.patch,1.22 KB, patch)
2005-10-07 01:28 UTC, Jan Bruvoll
Details | Diff
Patch to enable gnbd-client to manage multiple imports (gnbd-client.patch,1.16 KB, patch)
2005-10-07 01:32 UTC, Jan Bruvoll
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Bruvoll 2005-10-07 01:18:24 UTC
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.
Comment 1 Jan Bruvoll 2005-10-07 01:28:19 UTC
Created attachment 70054 [details, diff]
Patch to enable gnbd-srv to manage multiple exports
Comment 2 Jan Bruvoll 2005-10-07 01:32:27 UTC
Created attachment 70055 [details, diff]
Patch to enable gnbd-client to manage multiple imports
Comment 3 Jan Bruvoll 2005-10-07 01:52:13 UTC
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 4 Jan Bruvoll 2005-10-07 01:52:42 UTC
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
 }
Comment 5 Christian Zoffoli (RETIRED) gentoo-dev 2005-10-07 12:51:15 UTC
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).