[Unit]
Description=Starts the OpenSM InfiniBand fabric Subnet Managers
Documentation=man:opensm(8)
Before=network.target remote-fs-pre.target
ConditionPathExists=/sys/class/infiniband_mad/abi_version
[Service]
Type=oneshot
EnvironmentFile=/etc/default/opensm
ExecCondition=/bin/sh -c 'if test "$PORTS" = NONE; then echo "opensm is disabled via PORTS=NONE."; exit 1; fi'
ExecStart=/bin/sh -c 'if test "$PORTS" = ALL; then PORTS=$(/usr/sbin/ibstat -p); if test -z "$PORTS"; then echo "No InfiniBand ports found."; exit 0; fi; fi; echo "Starting opensm on following ports: $PORTS"; systemctl start $(echo $PORTS | sed -r "s/(\\w+)/opensm@\\1.service/g")'
RemainAfterExit=on
[Install]
WantedBy=network-online.target
|