File: swift-account-generator

package info (click to toggle)
swift 2.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,768 kB
  • sloc: python: 197,574; sh: 636; pascal: 253; makefile: 69; xml: 32
file content (32 lines) | stat: -rwxr-xr-x 713 bytes parent folder | download | duplicates (7)
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