diff options
author | James Harvey | 2016-07-14 21:35:13 -0400 |
---|---|---|
committer | James Harvey | 2016-07-14 21:35:13 -0400 |
commit | 6b5a3946cff92868f6d86a055381a3f38c298648 (patch) | |
tree | bbb975a42078abf5e66593b42b0af46225c161d2 | |
parent | 260e840e93053d363b70190f83bd589f9b4e80dd (diff) | |
download | aur-6b5a3946cff92868f6d86a055381a3f38c298648.tar.gz |
Integrated Fedora's method for easier handling of multiple interfaces
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | opensm.launch | 43 | ||||
-rw-r--r-- | opensm.service | 2 | ||||
-rw-r--r-- | opensm_extra.conf | 73 |
5 files changed, 124 insertions, 15 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Fri Jul 15 01:14:00 UTC 2016 +# Fri Jul 15 01:34:41 UTC 2016 pkgbase = opensm-systemd-multiple-interfaces pkgdesc = OpenFabrics Alliance InfiniBand Subnet Manager and Administrator pkgver = 3.3.20 @@ -16,9 +16,11 @@ pkgbase = opensm-systemd-multiple-interfaces source = https://www.openfabrics.org/downloads/management/opensm-3.3.20.tar.gz source = opensm.service source = opensm.launch + source = opensm_extra.conf md5sums = ed615b4681e94ef2e13a5de773ab89a3 - md5sums = f1155dd8fb07ce56c427bceb7ce3fffb - md5sums = 7cd151f96d46ba1bc651fce0e2b7e8dc + md5sums = d70efe82917527515520aca4fff840e9 + md5sums = b8827f86be787ede5093c7395bb03928 + md5sums = 733983c333d652907145a7ae8ab09d85 pkgname = opensm-systemd-multiple-interfaces @@ -17,10 +17,12 @@ conflicts=('opensm') depends=('libibumad' 'rdma') source=("https://www.openfabrics.org/downloads/management/${_pkgbase}-${pkgver}.tar.gz" 'opensm.service' - 'opensm.launch') + 'opensm.launch' + 'opensm_extra.conf') md5sums=('ed615b4681e94ef2e13a5de773ab89a3' - 'f1155dd8fb07ce56c427bceb7ce3fffb' - '7cd151f96d46ba1bc651fce0e2b7e8dc') + 'd70efe82917527515520aca4fff840e9' + 'b8827f86be787ede5093c7395bb03928' + '733983c333d652907145a7ae8ab09d85') build() { cd "${srcdir}/${_pkgbase}-${pkgver}" @@ -40,11 +42,8 @@ package() { # Convert from init.d to systemd rm -rf ${pkgdir}/etc/init.d - # If ${pkgdir}/etc is empty (it should be, since /etc/init.d/ was removed) remove it - if ! [ "$(ls -A ${pkgdir}/etc)" ]; then - rm -rf ${pkgdir}/etc/ - fi install -Dm644 "${srcdir}/opensm.service" "${pkgdir}/usr/lib/systemd/system/opensm.service" install -Dm755 "${srcdir}/opensm.launch" "${pkgdir}/usr/bin/opensm.launch" + install -Dm644 "${srcdir}/opensm_extra.conf" "${pkgdir}/etc/opensm_extra.conf" } diff --git a/opensm.launch b/opensm.launch index 08f0b1f5ec2f..8b721c4bede4 100644 --- a/opensm.launch +++ b/opensm.launch @@ -1,9 +1,44 @@ #!/bin/bash -# Copied from Fedora's opensm-3.3.17-4.fc22.x86_64.rpm -# Modified to just launch opensm -# Will come back to adding multiple OpenSM daemons running at once, which is what the rest of Fedora's version is for +# Copied from Fedora's opensm-3.3.19-1.fc23.src.rpm +# Modified for Arch # # Launch the necessary OpenSM daemons for systemd +# +# Config files: /etc/opensm.conf (created by opensm), and additional /etc/opensm_extra.conf and /etc/opensm/opensm.conf.[0-9]* + +shopt -s nullglob + +prog=/usr/bin/opensm +[ -f /etc/opensm_extra.conf ] && . /etc/opensm_extra.conf + +[ -n "$PRIORITY" ] && prio="-p $PRIORITY" -(while true; do /usr/bin/opensm; sleep 30; done) & +if [ -z "$GUIDS" ]; then + CONFIGS="" + CONFIG_CNT=0 + for conf in /etc/opensm/opensm.conf.[0-9]*; do + CONFIGS="$CONFIGS $conf" + let CONFIG_CNT++ + done +else + GUID_CNT=0 + for guid in $GUIDS; do + let GUID_CNT++ + done +fi +# Start opensm +if [ -n "$GUIDS" ]; then + SUBNET_COUNT=0 + for guid in $GUIDS; do + SUBNET_PREFIX=`printf "0xfe800000000000%02d" $SUBNET_COUNT` + (while true; do $prog $prio -g $guid --subnet_prefix $SUBNET_PREFIX; sleep 30; done) & + let SUBNET_COUNT++ + done +elif [ -n "$CONFIGS" ]; then + for config in $CONFIGS; do + (while true; do $prog $prio -F $config; sleep 30; done) & + done +else + (while true; do $prog $prio; sleep 30; done) & +fi exit 0 diff --git a/opensm.service b/opensm.service index edf2b9551273..fd08793117cb 100644 --- a/opensm.service +++ b/opensm.service @@ -1,4 +1,4 @@ -# Copied from Fedora's opensm-3.3.17-4.fc22.x86_64.rpm +# Copied from Fedora's opensm-3.3.19-1.fc23.srpm # Modified to follow Arch layout [Unit] diff --git a/opensm_extra.conf b/opensm_extra.conf new file mode 100644 index 000000000000..4b76b6ea2787 --- /dev/null +++ b/opensm_extra.conf @@ -0,0 +1,73 @@ +# Copied from Fedora's opensm-3.3.19-1.fc23.src.rpm +# Problem #1: Multiple IB fabrics needing a subnet manager +# +# In the event that a machine has more than one IB subnet attached, +# and that machine is an opensm server, by default, opensm will +# only attach to one port and will not manage the fabric on the +# other port. There are two ways to solve this problem: +# +# 1) Start opensm on multiple machines and configure it to manage +# different fabrics on each machine +# 2) Configure opensm to start multiple instances on a single +# machine +# +# Both solutions to this problem require non-standard configurations. +# In other words, you would normally have to modify /etc/rdma/opensm.conf +# and once you do that, the file will no longer be updated for new +# options when opensm is upgraded. In an effort to allow people to +# have more than one subnet managed by opensm without having to modify +# the system default opensm.conf file, we have enabled two methods +# for modifying the default opensm config items needed to enable +# multiple fabric management. +# +# Method #1: Create multiple opensm.conf files in non-standard locations +# Copy /etc/rdma/opensm.conf to /etc/rdma/opensm.conf.<number> +# (do this once for each instance you want started) +# Edit each copy of the opensm.conf file to reflect the necessary changes +# for a multiple instance startup. If you need to manage more than +# one fabric, you will have to change the guid option in each file +# to specify the guid of the specific port you want opensm attached +# to. +# +# The advantage to method #1 is that, on the off chance you want to do +# really special custom things on different ports, like have different +# QoS settings depending on which port you are attached to, you have the +# freedom to edit any and all settings for each instance without those +# changes affecting other instances or being lost when opensm upgrades. +# +# Method #2: Specify multiple GUIDS variable entries in this file +# Uncomment the below GUIDS variable and enter each guid you need to attach +# to into the list. If using this method you need to enter each +# guid into the list as we won't attach to any default ports, only +# those specified in the list. +# +#GUIDS="0x0002c90300048ca1 0x0002c90300048ca2" +# +# The obvious advantage to method #2 is that it's simple and doesn't +# clutter up your file system, but it is far more limited in what you +# can do. If you enable method #2, then even if you create the files +# referenced in method #1, they will be ignored. +# +# Problem #2: Activating a backup subnet manager +# +# The default priority of opensm is set so that it wants to be the +# primary subnet manager. This is great when you are only running +# opensm on one server, but if you want to have a non-primary opensm +# instance for failover, then you have to manually edit the opensm.conf +# file like for problem #1. This carries with it all the problems +# listed above. If you wish to enable opensm as a non-primary manager, +# then you can uncomment the PRIORITY variable below and set it to +# some number between 0 and 15, where 15 is the highest priority and +# the primary manager, with 0 being the lowest backup server. This method +# will work with the GUIDS option above, and also with the multiple +# config files in method #1 above. However, only a single priority is +# supported here. If you wanted more than one priority (say this machine +# is the primary on the first fabric, and second on the second fabric, +# while the other opensm server is primary on the second fabric and +# second on the primary), then the only way to do that is to use method #1 +# above and individually edit the config files. If you edit the config +# files to set the priority and then also set the priority here, then +# this setting will override the config files and render that particular +# edit useless. +# +#PRIORITY=15 |