Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-block/open-iscsi/files: iscsid-2.0.871-r1.init.d iscsid-conf.d
Date: Thu, 09 Feb 2012 08:35:15
Message-Id: 20120209083505.985F72004B@flycatcher.gentoo.org
1 robbat2 12/02/09 08:35:05
2
3 Modified: iscsid-2.0.871-r1.init.d iscsid-conf.d
4 Log:
5 Bug #307619: improve init script for BL2.
6
7 (Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.2 sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d?r1=1.1&r2=1.2
15
16 Index: iscsid-2.0.871-r1.init.d
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -p -w -b -B -u -u -r1.1 -r1.2
22 --- iscsid-2.0.871-r1.init.d 12 Nov 2009 09:29:48 -0000 1.1
23 +++ iscsid-2.0.871-r1.init.d 9 Feb 2012 08:35:05 -0000 1.2
24 @@ -1,7 +1,7 @@
25 #!/sbin/runscript
26 -# Copyright 1999-2008 Gentoo Technologies, Inc.
27 +# Copyright 1999-2012 Gentoo Technologies, Inc.
28 # Distributed under the terms of the GNU General Public License, v2 or later
29 -# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d,v 1.1 2009/11/12 09:29:48 robbat2 Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-2.0.871-r1.init.d,v 1.2 2012/02/09 08:35:05 robbat2 Exp $
31
32 opts="${opts} starttargets stoptargets restarttargets"
33
34 @@ -10,6 +10,9 @@ depend() {
35 use net
36 }
37
38 +PIDFILE=${PIDFILE:-/var/run/${SVCNAME}.pid}
39 +BINARY="/usr/sbin/iscsid"
40 +
41 checkconfig() {
42 if [ ! -e /etc/conf.d/${SVCNAME} ]; then
43 eerror "Config file /etc/conf.d/${SVCNAME} does not exist!"
44 @@ -71,7 +74,7 @@ start() {
45 fi
46
47 ebegin "Starting ${SVCNAME}"
48 - start-stop-daemon --start --quiet --exec /usr/sbin/iscsid -- ${OPTS}
49 + start-stop-daemon --start --quiet --exec ${BINARY} -- ${OPTS}
50 ret=$?
51 if [ $ret -ne 0 ]; then
52 eend $?
53 @@ -81,7 +84,11 @@ start() {
54 # Start automatic targets when iscsid is started
55 if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
56 starttargets
57 - return $?
58 + ret=$?
59 + if [ "${AUTOSTART}" = "strict" ] && [ $ret -ne 0 ]; then
60 + stop
61 + return $ret
62 + fi
63 fi
64 return 0
65 }
66 @@ -89,12 +96,9 @@ start() {
67 stop() {
68 stoptargets
69 ebegin "Stopping ${SVCNAME}"
70 - start-stop-daemon --signal HUP --stop --quiet --exec /usr/sbin/iscsid #--pidfile $PID_FILE
71 + start-stop-daemon --stop --quiet --exec ${BINARY} --pidfile ${PIDFILE}
72 eend $?
73
74 - # ugly, but pid file is not removed by iscsid
75 - rm -f $PID_FILE
76 -
77 do_modules 'Removing iSCSI modules' 'iscsi_tcp scsi_transport_iscsi libiscsi' '-r'
78 eend $?
79 }
80
81
82
83 1.2 sys-block/open-iscsi/files/iscsid-conf.d
84
85 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-conf.d?rev=1.2&view=markup
86 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-conf.d?rev=1.2&content-type=text/plain
87 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/open-iscsi/files/iscsid-conf.d?r1=1.1&r2=1.2
88
89 Index: iscsid-conf.d
90 ===================================================================
91 RCS file: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-conf.d,v
92 retrieving revision 1.1
93 retrieving revision 1.2
94 diff -p -w -b -B -u -u -r1.1 -r1.2
95 --- iscsid-conf.d 20 Mar 2009 16:23:50 -0000 1.1
96 +++ iscsid-conf.d 9 Feb 2012 08:35:05 -0000 1.2
97 @@ -11,3 +11,8 @@ OPTS="-i ${INITIATORNAME_FILE}"
98
99 # Start automatic targets when iscsid is started
100 AUTOSTARTTARGETS="yes"
101 +
102 +# if set to "strict", iscsid will stop, if connecting the
103 +# autostart targets failed
104 +# AUTOSTART="strict"
105 +