1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#!/bin/sh
# This systemd generator creates dependency symlinks that make all
# Swift account servers be started/stopped/reloaded
# when swift-account*.service is started/stopped/reloaded.
set -eu
GENDIR="$1"
LIBDIR="/lib/systemd/system"
CONFIG=/etc/swift/account-server
if [ ! -d "$CONFIG" ] ; then
# Single config mode
exit 0
fi
for NAME in $CONFIG/* ; do
NAME=${NAME#$CONFIG}
NAME=${NAME#/}
NAME=${NAME%.conf}
for i in account account-auditor account-reaper account-replicator ; do
mkdir -p "$GENDIR/swift-$i.service.wants"
ln -s \
"$LIBDIR/swift-$i@.service" \
"$GENDIR/swift-$i.service.wants/swift-$i@$NAME.service"
done
done
exit 0
|