summaryrefslogtreecommitdiff
path: root/usr/src/cmd/cmd-inet/usr.lib
diff options
context:
space:
mode:
authorHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2021-08-04 15:22:53 +0200
committerHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2021-11-22 12:30:03 +0100
commita73be61a80f7331c35adfa540bcf8f1546ff1e33 (patch)
treec0c72232c78479d3333c9ec6efdc60f0e75f6784 /usr/src/cmd/cmd-inet/usr.lib
parentf81209f5137586c57e31f7d74b929149299d9b3c (diff)
downloadillumos-gate-a73be61a80f7331c35adfa540bcf8f1546ff1e33.tar.gz
2554 ipadm needs IPMP configuration support
Contributed by: Ivan Krivonos <ivan.krivonos@nexenta.com> Contributed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: C Fraire <cfraire@me.com> Reviewed by: Yuri Pankov <ypankov@tintri.com> Reviewed by: Andy Fiddaman <andyf@omnios.com> Reviewed by: Ryan Goodfellow <ryan.goodfellow@oxide.computer> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/cmd/cmd-inet/usr.lib')
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile17
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.mpathd/net-ipmp31
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.mpathd/network-ipmp.xml78
3 files changed, 117 insertions, 9 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
index 3668af100b..d63134dae8 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
@@ -22,16 +22,21 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
+#
PROG = in.mpathd
ROOTFS_PROG = $(PROG)
OBJS = mpd_tables.o mpd_main.o mpd_probe.o
SRCS = $(OBJS:%.o=%.c)
DEFAULTFILES = mpathd.dfl
+SVCMETHOD = net-ipmp
+MANIFEST = network-ipmp.xml
include ../../../Makefile.cmd
ROOTCMDDIR = $(ROOT)/lib/inet
+ROOTMANIFESTDIR = $(ROOTSVCNETWORK)
POFILE = $(PROG).po
POFILES = $(SRCS:%.c=%.po)
@@ -63,15 +68,9 @@ $(PROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
$(POST_PROCESS)
-include ../Makefile.lib
-
-$(ROOTLIBINETPROG):
- $(RM) $@; $(SYMLINK) ../../../lib/inet/$(PROG) $@
-
-$(ROOTSBINPROG):
- $(RM) $@; $(SYMLINK) ../lib/inet/$(PROG) $@
+check: $(CHKMANIFEST)
-install: all $(ROOTLIBINETPROG) $(ROOTSBINPROG) $(ROOTCMD) \
+install: all $(ROOTCMD) $(ROOTMANIFEST) $(ROOTSVCMETHOD) \
$(ROOTETCDEFAULTFILES)
clean:
@@ -79,7 +78,7 @@ clean:
lint: lint_SRCS
-$(POFILE): $(POFILES)
+$(POFILE): $(POFILES)
$(RM) $@
$(CAT) $(POFILES) > $@
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/net-ipmp b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/net-ipmp
new file mode 100644
index 0000000000..be4263a74b
--- /dev/null
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/net-ipmp
@@ -0,0 +1,31 @@
+#!/sbin/sh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
+#
+
+. /lib/svc/share/smf_include.sh
+
+if [ -z "$SMF_FMRI" ]; then
+ echo "this script can only be invoked by smf(5)"
+ exit $SMF_EXIT_ERR_NOSMF
+fi
+
+smf_configure_ip || exit $SMF_EXIT_ERR_FATAL
+
+if /lib/inet/in.mpathd; then
+ exit $SMF_EXIT_OK
+else
+ exit $SMF_EXIT_ERR_FATAL
+fi
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/network-ipmp.xml b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/network-ipmp.xml
new file mode 100644
index 0000000000..282bf5b4df
--- /dev/null
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/network-ipmp.xml
@@ -0,0 +1,78 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+
+<!--
+ Copyright 2021 Tintri by DDN, Inc. All rights reserved.
+
+ This file and its contents are supplied under the terms of the
+ Common Development and Distribution License ("CDDL"), version 1.0.
+ You may only use this file in accordance with the terms of version
+ 1.0 of the CDDL.
+
+ A full copy of the text of the CDDL should have accompanied this
+ source. A copy of the CDDL is also available via the Internet at
+ http://www.illumos.org/license/CDDL.
+
+ NOTE: This service manifest is not editable; its contents will
+ be overwritten by package or patch operations, including
+ operating system upgrade. Make customizations in a different
+ file.
+-->
+
+<service_bundle type='manifest' name='SUNWcsr:ipmp'>
+
+<service
+ name='network/ipmp'
+ type='service'
+ version='1'>
+
+ <create_default_instance enabled='true' />
+
+ <dependency name='loopback' grouping='require_all' restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/network/loopback' />
+ </dependency>
+
+ <dependent name='network-physical' grouping='optional_all'
+ restart_on='none'>
+ <service_fmri value='svc:/network/physical:default' />
+ </dependent>
+
+ <exec_method type='method' name='start' exec='/lib/svc/method/net-ipmp'
+ timeout_seconds='60'>
+ </exec_method>
+
+ <exec_method type='method' name='stop' exec=':kill'
+ timeout_seconds='60'>
+ </exec_method>
+
+ <exec_method type='method' name='refresh' exec=':kill -HUP'
+ timeout_seconds='60'>
+ </exec_method>
+
+ <property_group name='config' type='application'>
+ <propval name='action_authorization' type='astring'
+ value='solaris.smf.manage.ipmp' />
+ </property_group>
+
+ <property_group name='general' type='framework'>
+ <propval name='action_authorization' type='astring'
+ value='solaris.smf.manage.ipmp' />
+ <propval name='value_authorization' type='astring'
+ value='solaris.smf.manage.ipmp' />
+ </property_group>
+
+ <stability value='Unstable' />
+
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>
+ IP MultiPathing
+ </loctext>
+ </common_name>
+ <documentation>
+ <manpage title='in.mpathd' section='1M' />
+ </documentation>
+ </template>
+</service>
+</service_bundle>