From: | "Mike Doty (kingtaco)" <kingtaco@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in sys-block/open-iscsi/files: iscsid-2.0.868_rc1.conf.d iscsid-2.0.868_rc1.init.d |
Date: | Tue, 25 Mar 2008 02:33:13 |
Message-Id: | E1JdyyH-0007Fb-4Z@stork.gentoo.org |
1 | kingtaco 08/03/25 02:33:05 |
2 | |
3 | Added: iscsid-2.0.868_rc1.conf.d iscsid-2.0.868_rc1.init.d |
4 | Log: |
5 | adding open-iscsi-2.0.868_rc1.ebuild and related files thanks to Craig <craig -at- haquarter.de> Bug 196096 |
6 | (Portage version: 2.1.4.4) |
7 | |
8 | Revision Changes Path |
9 | 1.1 sys-block/open-iscsi/files/iscsid-2.0.868_rc1.conf.d |
10 | |
11 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.868_rc1.conf.d?rev=1.1&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.868_rc1.conf.d?rev=1.1&content-type=text/plain |
13 | |
14 | Index: iscsid-2.0.868_rc1.conf.d |
15 | =================================================================== |
16 | # /etc/conf.d/iscsid |
17 | |
18 | # config file to use |
19 | CONFIG_FILE=/etc/iscsi/iscsid.conf |
20 | |
21 | # you need to specify an initiatorname in the file |
22 | INITIATORNAME_FILE=/etc/iscsi/initiatorname.iscsi |
23 | |
24 | # options to pass to iscsid |
25 | OPTS="-i ${INITIATORNAME_FILE}" |
26 | |
27 | |
28 | |
29 | |
30 | 1.1 sys-block/open-iscsi/files/iscsid-2.0.868_rc1.init.d |
31 | |
32 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.868_rc1.init.d?rev=1.1&view=markup |
33 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.868_rc1.init.d?rev=1.1&content-type=text/plain |
34 | |
35 | Index: iscsid-2.0.868_rc1.init.d |
36 | =================================================================== |
37 | #!/sbin/runscript |
38 | # Copyright 1999-2005 Gentoo Technologies, Inc. |
39 | # Distributed under the terms of the GNU General Public License, v2 or later |
40 | # $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.868_rc1.init.d,v 1.1 2008/03/25 02:33:04 kingtaco Exp $ |
41 | |
42 | depend() { |
43 | after modules |
44 | use net |
45 | } |
46 | |
47 | checkconfig() { |
48 | if [ ! -f $CONFIG_FILE ]; then |
49 | eerror "Config file $CONFIG_FILE does not exist!" |
50 | return 1 |
51 | fi |
52 | if ! grep "^InitiatorName=iqn." ${INITIATORNAME_FILE} &>/dev/null; then |
53 | ewarn "${INITIATORNAME_FILE} should contain a string with your initiatior name." |
54 | IQN=iqn.$(date +%Y-%m).$(hostname -f | awk 'BEGIN { FS=".";}{x=NF; while (x>0) {printf $x ;x--; if (x>0) printf ".";} print ""}'):openiscsi |
55 | IQN=${IQN}-$(echo ${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM} | md5sum | sed -e "s/\(.*\) -/\1/g" -e 's/ //g') |
56 | ebegin "Creating InitiatorName ${IQN} in ${INITIATORNAME_FILE}" |
57 | echo "InitiatorName=${IQN}" >> ${INITIATORNAME_FILE} |
58 | eend $? |
59 | fi |
60 | } |
61 | |
62 | do_modules() { |
63 | msg="$1" |
64 | shift |
65 | modules="$1" |
66 | shift |
67 | opts="$@" |
68 | for m in ${modules}; do |
69 | ebegin "${msg} - ${m}" |
70 | modprobe ${opts} $m |
71 | ret=$? |
72 | eend $ret |
73 | [ $ret -ne 0 ] && return $ret |
74 | done |
75 | return 0 |
76 | } |
77 | |
78 | start() { |
79 | checkconfig |
80 | do_modules 'Loading iSCSI modules' 'scsi_transport_iscsi iscsi_tcp' |
81 | ret=$? |
82 | [ $ret -ne 0 ] && return 1 |
83 | ebegin "Starting ${SVCNAME}" |
84 | start-stop-daemon --start --quiet --exec /usr/sbin/iscsid -- ${OPTS} |
85 | ret=$? |
86 | eend $ret |
87 | return $ret |
88 | } |
89 | |
90 | stop() { |
91 | ebegin "Stopping ${SVCNAME}" |
92 | start-stop-daemon --signal HUP --stop --quiet --exec /usr/sbin/iscsid #--pidfile $PID_FILE |
93 | eend $? |
94 | |
95 | # ugly, but pid file is not removed by iscsid |
96 | rm -f $PID_FILE |
97 | |
98 | do_modules 'Removing iSCSI modules' 'iscsi_tcp scsi_transport_iscsi' '-r' |
99 | ret=$? |
100 | return $ret |
101 | } |
102 | |
103 | |
104 | |
105 | |
106 | -- |
107 | gentoo-commits@l.g.o mailing list |