Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add rc script for /sbin/iscsid.



details:   https://anonhg.NetBSD.org/src/rev/3e93523adf62
branches:  trunk
changeset: 336256:3e93523adf62
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Feb 21 23:13:00 2015 +0000

description:
Add rc script for /sbin/iscsid.

diffstat:

 distrib/sets/lists/etc/mi        |   3 ++-
 etc/defaults/rc.conf             |   4 +++-
 etc/mtree/special                |   3 ++-
 etc/rc.d/Makefile                |   4 ++--
 etc/rc.d/iscsid                  |  37 +++++++++++++++++++++++++++++++++++++
 usr.sbin/postinstall/postinstall |   3 ++-
 6 files changed, 48 insertions(+), 6 deletions(-)

diffs (130 lines):

diff -r 874fabca8e77 -r 3e93523adf62 distrib/sets/lists/etc/mi
--- a/distrib/sets/lists/etc/mi Sat Feb 21 20:33:44 2015 +0000
+++ b/distrib/sets/lists/etc/mi Sat Feb 21 23:13:00 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.234 2015/01/25 15:50:30 christos Exp $
+# $NetBSD: mi,v 1.235 2015/02/21 23:13:00 joerg Exp $
 #
 # Note: end-user configuration files that are moved to another location
 #      should not be marked "obsolete"; they should just be removed from
@@ -216,6 +216,7 @@
 ./etc/rc.d/ipsec                               etc-net-rc
 ./etc/rc.d/irdaattach                          etc-sys-rc
 ./etc/rc.d/iscsi_target                                etc-iscsi-rc
+./etc/rc.d/iscsid                              etc-iscsi-rc
 ./etc/rc.d/isdnd                               etc-isdn-rc
 ./etc/rc.d/isibootd                            etc-bootserver-rc
 ./etc/rc.d/kdc                                 etc-krb5-rc
diff -r 874fabca8e77 -r 3e93523adf62 etc/defaults/rc.conf
--- a/etc/defaults/rc.conf      Sat Feb 21 20:33:44 2015 +0000
+++ b/etc/defaults/rc.conf      Sat Feb 21 23:13:00 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: rc.conf,v 1.130 2015/01/25 16:26:34 christos Exp $
+#      $NetBSD: rc.conf,v 1.131 2015/02/21 23:13:00 joerg Exp $
 #
 # /etc/defaults/rc.conf --
 #      default configuration of /etc/rc.conf
@@ -297,6 +297,8 @@
 
 # iSCSI target
 iscsi_target=NO                iscsi_target_flags=""
+# iSCSI kernel initiator
+iscsid=NO
 
 # WPA daemons.
 hostapd=NO             hostapd_flags="-B /etc/hostapd.conf"
diff -r 874fabca8e77 -r 3e93523adf62 etc/mtree/special
--- a/etc/mtree/special Sat Feb 21 20:33:44 2015 +0000
+++ b/etc/mtree/special Sat Feb 21 23:13:00 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: special,v 1.150 2014/12/30 03:52:03 uebayasi Exp $
+#      $NetBSD: special,v 1.151 2015/02/21 23:13:00 joerg Exp $
 #      @(#)special     8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -221,6 +221,7 @@
 ./etc/rc.d/ipsec               type=file mode=0555
 ./etc/rc.d/irdaattach          type=file mode=0555
 ./etc/rc.d/iscsi_target                type=file mode=0555
+./etc/rc.d/iscsid              type=file mode=0555
 ./etc/rc.d/isdnd               type=file mode=0555
 ./etc/rc.d/isibootd            type=file mode=0555
 ./etc/rc.d/kdc                 type=file mode=0555
diff -r 874fabca8e77 -r 3e93523adf62 etc/rc.d/Makefile
--- a/etc/rc.d/Makefile Sat Feb 21 20:33:44 2015 +0000
+++ b/etc/rc.d/Makefile Sat Feb 21 23:13:00 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.90 2014/09/11 18:01:22 roy Exp $
+# $NetBSD: Makefile,v 1.91 2015/02/21 23:13:00 joerg Exp $
 
 .include <bsd.own.mk>
 
@@ -23,7 +23,7 @@
                gpio \
                hostapd httpd \
                identd ifwatchd inetd ipfilter ipfs ipmon ipnat ipsec \
-               irdaattach iscsi_target isdnd isibootd \
+               irdaattach iscsi_target iscsid isdnd isibootd \
                kdc \
                ldconfig ldpd local lpd lvm \
                makemandb mdnsd mixerctl mopd motd mountall mountcritlocal \
diff -r 874fabca8e77 -r 3e93523adf62 etc/rc.d/iscsid
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/iscsid   Sat Feb 21 23:13:00 2015 +0000
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $NetBSD: iscsid,v 1.1 2015/02/21 23:13:00 joerg Exp $
+#
+
+# PROVIDE: iscsid
+# REQUIRE: NETWORKING mountcritlocal
+# BEFORE:  securelevel mountcritremote
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="iscsid"
+rcvar=$name
+command="/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+start_precmd="iscsid_precmd"
+
+find_module()
+{
+       local module rest
+       /sbin/modstat $1 | while read module rest; do
+               if [ "$module" = "$1" ]; then
+                       echo found
+                       break
+               fi
+       done
+}
+
+iscsid_precmd()
+{
+       if [ "$(find_module iscsi)" != "found" ]; then
+               /sbin/modload iscsi
+       fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 874fabca8e77 -r 3e93523adf62 usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Sat Feb 21 20:33:44 2015 +0000
+++ b/usr.sbin/postinstall/postinstall  Sat Feb 21 23:13:00 2015 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.188 2014/12/30 07:02:29 apb Exp $
+# $NetBSD: postinstall,v 1.189 2015/02/21 23:13:00 joerg Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1354,6 +1354,7 @@
 ipsec
 irdaattach
 iscsi_target
+iscsid
 isdnd
 isibootd
 kdc



Home | Main Index | Thread Index | Old Index