use journal namespace
This commit is contained in:
1 parent
ae4299a570
commit
4f0886b6cd
11 files changed
+201
-21
No files matched your search
@@ -1 +1,2 @@
|
||||
/etc/default/terractl
|
||||
/etc/systemd/journald@terraria.conf
|
||||
@@ -8,6 +8,17 @@ case "$1" in
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload || true
|
||||
fi
|
||||
# Let the terraria group read the servers' journal (LogNamespace=terraria)
|
||||
terractl journal-access || true
|
||||
# Servers running from before 0.0.11 still log to the system journal until
|
||||
# restarted, so 'terractl attach' and 'cmd' can't show their output yet.
|
||||
if [ -n "$2" ] && dpkg --compare-versions "$2" lt 0.0.11 && [ -d /run/systemd/system ]; then
|
||||
running=$(systemctl list-units --plain --no-legend --state=active 'terraria@*.service' | awk '{print $1}')
|
||||
if [ -n "$running" ]; then
|
||||
echo "Restart running Terraria servers so they use their new journal:"
|
||||
for unit in $running; do echo " sudo systemctl restart $unit"; done
|
||||
fi
|
||||
fi
|
||||
# Running instances are not restarted; they pick up changes on their next start.
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in new issue
Block a user