3
# This systemd generator creates dependency symlinks that make all PostgreSQL
4
# clusters with "auto" in their start.conf file be started/stopped/reloaded
5
# when postgresql.service is started/stopped/reloaded.
10
wantdir="$1/postgresql.service.wants"
11
pgservice="/lib/systemd/system/postgresql@.service"
15
for conf in /etc/postgresql/*/*/postgresql.conf; do
16
test -e "$conf" || continue
20
if [ -e "$dir/start.conf" ]; then
21
start=$(sed 's/#.*$//; /^[[:space:]]*$/d; s/^\s*//; s/\s*$//' "$dir/start.conf")
25
[ "$start" = "auto" ] || continue
28
version="${verdir##*/}"
30
ln -s "$pgservice" "$wantdir/postgresql@$version-$cluster.service"