# ChangeLog for sys-block/open-iscsi
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
+
+ 20 Sep 2005; Robin H. Johnson <robbat2@gentoo.org> files/iscsid-init.d,
+ open-iscsi-0.4.413.ebuild:
+ Change SRC_URI to mirror://gentoo/ now that the source has spread, also
+ clean up install location for modules, security of config file and
+ databases, and clean up the init script to be gentoo-like instead of
+ debian-like.
*open-iscsi-0.4.413 (20 Sep 2005)
-MD5 f3c0735d64f0ee90e74ef767e116af44 open-iscsi-0.4.413.ebuild 2100
-MD5 7c96acb098ff760945c04e20b47d6a07 ChangeLog 575
+MD5 88e0027844d0bb73925ed95ba41cd2ca open-iscsi-0.4.413.ebuild 2321
+MD5 e67529a6fb35ab7b06e53655d9cec5f3 ChangeLog 908
MD5 21cd68602737d7c996bceabf6e62c468 metadata.xml 223
MD5 ec58849ae9c14ba36b99b28f204bd9be files/initiatorname.iscsi 422
MD5 46455650192b84fe9800a574256ec67e files/digest-open-iscsi-0.4.413 70
-MD5 61c07f96dcbe59e3cb43ab7fb7de55c2 files/iscsid-init.d 1893
+MD5 ad2618aed85b081bedd4ebcf72316183 files/iscsid-init.d 2213
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
PID_FILE=/var/run/iscsid.pid
CONFIG_FILE=/etc/iscsid.conf
+DUMP_DIR=/var/db/iscsi
+DUMP_NODE="${DUMP_DIR}/node.dump"
+DUMP_DISCOVERY="${DUMP_DIR}/discovery.dump"
INITIATORNAME=/etc/initiatorname.iscsi
DAEMON=/usr/sbin/iscsid
start() {
checkconfig
- echo -n "Starting iSCSI initiator service: "
+ ebegin "Starting iSCSI initiator service"
modprobe scsi_transport_iscsi
modprobe iscsi_tcp
start-stop-daemon --start --exec $DAEMON --quiet
- RETVAL=$?
- if [ $RETVAL == "0" ]; then
- echo "succeeded."
- else
- echo "failed."
- fi
-
- echo -n "Removing iSCSI modules: "
- modprobe -r iscsi_tcp
- modprobe -r scsi_transport_iscsi
- RETVAL=$?
- if [ $RETVAL == "0" ]; then
- echo "succeeded."
- else
- echo "failed."
- return 1
- fi
+ ret=$?
+ eend $ret
+ [ $ret -gt 0 ] && return $ret
}
stop() {
- echo -n "Stopping iSCSI initiator service: "
+ ebegin "Stopping iSCSI initiator service"
start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE
- RETVAL=$?
- if [ $RETVAL == "0" ]; then
- echo "succeeded."
- else
- echo "failed."
- fi
+ eend $?
+
# ugly, but pid file is not removed by iscsid
rm -f $PID_FILE
+
+ ebegin "Removing iSCSI modules"
+ modprobe -r iscsi_tcp
+ modprobe -r scsi_transport_iscsi
+ ret=$?
+ eend $ret
+ [ $ret -gt 0 ] && return $ret
}
opts="${opts} dump"
dump() {
- DUMP=`tempfile -p iscsid`
- RETVAL=$?
- if [ $RETVAL != "0" ]; then
- echo "Failed to create dump file $DUMP"
- return 1
- fi
- /usr/sbin/iscsiadm -m node --record 0a45f8 >$DUMP
- RETVAL=$?
- if [ $RETVAL != "0" ]; then
- echo "Error dumping config from daemon"
- rm $DUMP
- return 1
- fi
- mv -u $DUMP $CONFIG_FILE
- echo "Config dumped to $CONFIG_FILE"
+ einfo "Starting dump of iscsid database (nodes)"
+ NODELIST="$(iscsiadm -m node | awk -F '[\\[\\]]' '{print $2}')"
+ [ -f ${DUMP_NODE} ] && mv -f ${DUMP_NODE} ${DUMP_NODE}.old
+ for i in $NODELIST ; do
+ echo "# $(iscsiadm -m node | egrep "^\[$i\]")" >>${DUMP_NODE}
+ iscsiadm -m node --record=$i >>${DUMP_NODE}
+ echo >>${DUMP_NODE}
+ done
+ einfo "Starting dump of iscsid database (discovery)"
+ DISCOVERYLIST="$(iscsiadm -m discovery | awk -F '[\\[\\]]' '{print $2}')"
+ [ -f ${DUMP_DISCOVERY} ] && mv -f ${DUMP_DISCOVERY} ${DUMP_DISCOVERY}.old
+ for i in $DISCOVERYLIST ; do
+ echo "# $(iscsiadm -m discovery | egrep "^\[$i\]")" >>${DUMP_DISCOVERY}
+ iscsiadm -m discovery --record=$i >>${DUMP_DISCOVERY}
+ echo >>${DUMP_DISCOVERY}
+ done
+
+ einfo "Config dumped to ${DUMP_DIR}/"
}
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-0.4.413.ebuild,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-0.4.413.ebuild,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
inherit versionator linux-mod eutils
HOMEPAGE="http://www.open-iscsi.org/"
MY_PV="$(replace_version_separator 2 '-')"
MY_P="${PN}-${MY_PV}"
-SRC_URI="http://dev.gentoo.org/~robbat2/distfiles/${MY_P}.tar.gz"
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
sys-apps/util-linux"
S="${WORKDIR}/${MY_P}"
-MODULE_NAMES_ARG="drivers/scsi:${S}/kernel"
+MODULE_NAMES_ARG="kernel/drivers/scsi:${S}/kernel"
MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG})"
BUILD_TARGETS="all"
CONFIG_CHECK="CRYPTO_MD5 CRYPTO_CRC32C"
doins etc/iscsid.conf
doins ${FILESDIR}/initiatorname.iscsi
newinitd ${FILESDIR}/iscsid-init.d iscsid
+
+ # security
+ keepdir /var/db/iscsi
+ fperms 700 /var/db/iscsi
+ fperms 600 /etc/iscsid.conf
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ [ -d /var/db/iscsi ] && chmod 700 /var/db/iscsi
+ [ -f /etc/iscsid.conf ] && chmod 600 /etc/iscsid.conf
}