Skip to content

Commit

Permalink
systemd: adding a global dcache.service which pulls in dcache@*.service
Browse files Browse the repository at this point in the history
Motivation:
It would be nice to have a “global” dcache.service, which can be used tostart/
stop/reaload/restart all the dcache@*.services (i.e. the single domains).

Also, it would be much better not to have to enable each dcache@*.service (which
all have different names) all the nodes of the cluster, just to get everything
started.
Enabling dcache.service can be used to have all dCache domains started, while
one can still fall back to only enable single dcache@*.service (and leave
dcache.service on a node).

Modification:
Introduce such a dcache.service unit, and modify the generated units, so that
they're “pulled in”.

Target: master
Require-notes: yes
Require-book: yes
Request: 3.2

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
  • Loading branch information
calestyo committed Nov 7, 2017
1 parent 3043743 commit 3bc9c49
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions skel/lib/systemd/system-generators/dcache-generator
Expand Up @@ -4,6 +4,10 @@ set -e

@DCACHE_LOAD_CONFIG@


wantdir="$1/dcache.service.wants"
mkdir "$wantdir"

for domain in $(getProperty dcache.domains); do
RESTART_DELAY="$(getProperty dcache.restart.delay "$domain")"
USER="$(getProperty dcache.user "$domain")"
Expand All @@ -16,6 +20,9 @@ for domain in $(getProperty dcache.domains); do
[Unit]
Description=dCache $domain domain
After=network.target zookeeper.service
PartOf=dcache.service
ReloadPropagatedFrom=dcache.service
Before=dcache.service
[Service]
Type=simple
Expand All @@ -35,4 +42,6 @@ for domain in $(getProperty dcache.domains); do
[Install]
WantedBy=default.target
EOF

ln -s "$1/dcache@$domain.service" "$wantdir/dcache@$domain.service"
done
14 changes: 14 additions & 0 deletions skel/lib/systemd/system/dcache.service
@@ -0,0 +1,14 @@
#systemd service for managing all dCache domains on the system. This service is
#actually a systemd target, but as targets cannot be reloaded a service is used.

[Unit]
Description=dCache

[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=default.target

0 comments on commit 3bc9c49

Please sign in to comment.