New init-script for iscsid

git-svn-id: svn+ssh://svnintern.kmrc.de/projects/gentoo/iwm-overlay@5328 cbe59ace-07ea-0310-918e-868702b5370d
This commit is contained in:
Torsten Kurbad 2007-08-12 21:05:05 +00:00
parent 8489833a21
commit 10ea654612
2 changed files with 20 additions and 14 deletions

View File

@ -6,10 +6,10 @@ AUX iscsid-conf.d 276 RMD160 3e6de6c30fb77b8731512867cab8e5801db76a72 SHA1 1b81a
MD5 5e73851b295d89f10df35d676d837b26 files/iscsid-conf.d 276
RMD160 3e6de6c30fb77b8731512867cab8e5801db76a72 files/iscsid-conf.d 276
SHA256 09d617fb76f8f61a1f99836286f424e0d9c0b57b9a382c3733ecb090b3fea100 files/iscsid-conf.d 276
AUX iscsid-init.d 4004 RMD160 2df205004ae5e3a5e8b00a8e228a559e2920a543 SHA1 eb721b08bab3802afec71d02a0b1af0ae9283874 SHA256 d4ca4e525ab8e73f131d74c9c73372ecf5f255b93a0a13133f812039dce71754
MD5 5053e158dde66377caeabf094f93e568 files/iscsid-init.d 4004
RMD160 2df205004ae5e3a5e8b00a8e228a559e2920a543 files/iscsid-init.d 4004
SHA256 d4ca4e525ab8e73f131d74c9c73372ecf5f255b93a0a13133f812039dce71754 files/iscsid-init.d 4004
AUX iscsid-init.d 4220 RMD160 af96c91d7c876735c35c26f971ecdcd2b5d382ba SHA1 ee6fd644eaecb6a518a7f121cc5be755b4778ac1 SHA256 04f0c4681a4c6741d7a96f58250f45177d685bb9446e0bd26201f9d565671d1f
MD5 6dedc8ed363ad5f1be79a65b297569f9 files/iscsid-init.d 4220
RMD160 af96c91d7c876735c35c26f971ecdcd2b5d382ba files/iscsid-init.d 4220
SHA256 04f0c4681a4c6741d7a96f58250f45177d685bb9446e0bd26201f9d565671d1f files/iscsid-init.d 4220
DIST open-iscsi-2.0-754.tar.gz 223383 RMD160 841035a1da90e701719f4f7989616de9f613aac6 SHA1 1506a293d48dc88aff09299cb8f6f9d236905dbd SHA256 fc286e8bc457612af733fafab0608a25280b81f7306c9f218c9361e1fd8e573e
EBUILD open-iscsi-2.0.754.ebuild 2365 RMD160 9c111ca890fcf37583cad293201c505900e4c0e5 SHA1 b4fe12f059f703fbc616e53cc19b520e312a7ea8 SHA256 121be1d84b9b981634ae79ff00d524dde5884d53d89f75eafb5570367df7ac47
MD5 fe064a87f0af29a40ad27486caedd070 open-iscsi-2.0.754.ebuild 2365

View File

@ -71,22 +71,28 @@ start() {
ebegin "Mounting all disks with entries in /etc/fstab"
PARTITIONS=""
ISCSI_SESSION="`iscsiadm -m session -i 2>/dev/null | grep '^Attached scsi disk '`"
ISCSI_SESSION="`iscsiadm -m session -i 2>/dev/null | grep '^Attached scsi disk ' | grep 'State: running$'`"
if [ "x${?}" == "x0" ] ; then
DISKS="`echo ${ISCSI_SESSION} | awk '{ print $4; }'`"
DISKS="`echo ${ISCSI_SESSION} | awk '{ print }' | sed -e 's@Attached scsi disk @@g' -e 's@State: running@@g'`"
for DISK in "${DISKS}" ; do
for DISK in ${DISKS} ; do
PARTITIONS="`find /dev -name \"${DISK}[0-9]*\" | grep -v '\.udev/'` ${PARTITIONS}"
done
for PARTITION in "${PARTITIONS}" ; do
PART_LABEL="`${UDEVINFO} -q env -n ${PARTITION} | grep '^ID_FS_LABEL=' | awk -F '=' '{ print $2; }'`"
for PARTITION in ${PARTITIONS} ; do
IN_FSTAB=""
PART_LABEL_RAW="`${UDEVINFO} -q env -n ${PARTITION} 2>/dev/null | grep '^ID_FS_LABEL='`"
if [ "${PART_LABEL_RAW}x" != "x" ] ; then
PART_LABEL="`echo ${PART_LABEL_RAW} | awk -F '=' '{ print $2; }'`"
IN_FSTAB="`grep ${PART_LABEL} /etc/fstab`"
fi
if [ "x${IN_FSTAB}" != "x" ] ; then
mount -s /dev/disk/by-label/${PART_LABEL}
fi
done
done
ret=$?
else