Skip to content

Commit

Permalink
systemd: fix generator run after reboot
Browse files Browse the repository at this point in the history
Motivation:
Linux shell (bash) by default uses /tmp directory for temporary files,
including for so called `here-document` (cat > << EOF...). When generator runs
the /root (thus /tmp, if not a dedicated partition) are mounted as read-only.

Modification:
Point shell to a read-write directory

Result:
dcache-generator successfully runs after restart

Fixes: #5527
Acked-by: Albert Rossi
Target: master, 7.0, 6.2
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann authored and alrossi committed Apr 15, 2021
1 parent 2469a66 commit 57423e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions skel/lib/systemd/system-generators/dcache-generator
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export PATH
wantdir="$1/dcache.target.wants"
mkdir "$wantdir"

#
# Linux shell by default uses /tmp directory for temporary files,
# including here-document (cat > << EOF...). When generator runs
# the /root (thus /tmp) are mounted read-only.
#
# Point shell to a read-write directory
export TMPDIR=/run/tmpfiles.d/

for domain in $(getProperty dcache.domains); do
RESTART_DELAY="$(getProperty dcache.restart.delay "$domain")"
USER="$(getProperty dcache.user "$domain")"
Expand Down

0 comments on commit 57423e5

Please sign in to comment.