summarylogtreecommitdiffstats
path: root/minecraftd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'minecraftd.sh')
-rwxr-xr-xminecraftd.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/minecraftd.sh b/minecraftd.sh
index 97615049ea1f..6a4203b5422a 100755
--- a/minecraftd.sh
+++ b/minecraftd.sh
@@ -407,7 +407,9 @@ server_command() {
# Enter the screen game session
server_console() {
if ${SUDO_CMD} screen -S "${SESSION_NAME}" -Q select . > /dev/null; then
- ${SUDO_CMD} screen -S "${SESSION_NAME}" -rx
+ # Circumvent a permission bug related to running GNU screen as a different user,
+ # see e.g. https://serverfault.com/questions/116775/sudo-as-different-user-and-running-screen
+ ${SUDO_CMD} script -q -c "screen -S \"${SESSION_NAME}\" -rx" /dev/null
else
echo "There is no ${SESSION_NAME} session to connect to."
fi