Re: Persisting vblade exports

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

 



Hi,

for those who are interested, here our systemd solution:

global config /etc/vblade.conf:
===============================
# example configuration file

# global variables
BUFFER_COUNT=16
===============================



local config for each target, e.g.:
/etc/vblade.conf.d/e02.08.conf
===============================
SHELF=2
SLOT=8
NETIF=bond-aoe
FILE=/dev/DRBD/KVM_ABC-DEF
MACS=XX:YY:ZZ:__:a5:85,XX:YY:ZZ:__:af:86,XX:YY:ZZ:__:21:40,XX:YY:ZZ:__:20:f0
===============================



systemd template file:
/lib/systemd/system/vblade@.service
===============================
# vblade target service
#
# 2017-01-26 Lars Täuber taeuber@xxxxxxx - initial version ported from upstart script

[Unit]
Description=vblade AoE target for %I
Requires=drbd.service
ConditionPathExists=/etc/vblade.conf
ConditionFileNotEmpty=/etc/vblade.conf.d/%I.conf
StartLimitInterval=2min
StartLimitBurst=19


[Service]
RestartSec=3
Restart=always
#Restart=on-failure
ExecStart=/bin/bash -c '								\
    . /etc/vblade.conf;									\
											\
    SHELF="%I";										\
     SLOT="${SHELF##*.}";								\
    SHELF="${SHELF%%.*}";								\
    SHELF="${SHELF#e}";									\
											\
    . /etc/vblade.conf.d/%I.conf;							\
											\
    MACS="$${MACS:+-m $$MACS}";								\
    BUFFER_COUNT="$${BUFFER_COUNT:+-b $$BUFFER_COUNT}";					\
											\
    exec vblade $$BUFFER_COUNT $$MACS $$(($$SHELF+0)) $$(($$SLOT +0)) $$NETIF $$FILE	\
'

[Install]
WantedBy=multi-user.target
===============================



to start a single target:
systemctl start vblade@e02.08

get status
systemctl status vblade@e02.08


stop *all* targets:
systemctl stop vblade@*



Hope this helps
Lars



Fri, 10 Nov 2017 19:30:14 +0100
Christoph Biedl <sourceforge.bnwi@xxxxxxxxxxxxxxxxxx> ==> aoetools-discuss@xxxxxxxxxxxxxxxxxxxxx :
> Hello,
> 
> for all the years I've been wondering how people persist their vblade
> instances, i.e. have some exports that are automatically started at
> bootup. Some hand-crafted shell scripts that call vbladed?
> 
> In the Debian project, there is a vblade-persist package which uses
> runit, and the maintainer/upstream (Cc:'d) has expressed his
> consideration of either giving it into other hands for major rework, or
> just removing (RM) it entirely.[1]
> 
> Now I am thinking about going the rework way: Create a simple
> configuration file format[2] for persistent vblade exports, and add
> support for at least systemd (via generators) and sysv (probably using
> the daemon[3] program as a supervisor).
> 
> Before re-inventing the wheel: Did I miss anything similar out there?
> Is this something for the vblade package? I could do this within
> Debian, but avoiding distribution-specific extensions was a plus.
> 
>     Christoph
> 
> [1] https://bugs.debian.org/862873
> 
> [2] Basically a POSIX shell fragment key/value store for
>     netif, shelf, slot, source, opts, mac, and ionice.
> 
> [3] http://www.libslack.org/daemon/


-- 
                            Informationstechnologie
Berlin-Brandenburgische Akademie der Wissenschaften
Jägerstraße 22-23                      10117 Berlin
Tel.: +49 30 20370-352           http://www.bbaw.de

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Aoetools-discuss mailing list
Aoetools-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/aoetools-discuss




[Index of Archives]     [Linux ARM Kernel]     [Linux SCSI]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux