From fbfc22b847f7234708e659643059a3bf2988588c Mon Sep 17 00:00:00 2001 From: PlusMinus Date: Tue, 1 Sep 2015 15:48:44 +0200 Subject: [PATCH] The JDownloader is now being run as a normal user. --- Dockerfile | 4 ++++ startJD2.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 659c9e0..237d0db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,10 @@ FROM java:jre MAINTAINER PlusMinus +# For running the JDownloder as a normal user +ENV UID=1000 +ENV GID=1000 + # Create directory, downloader JD" and start JD2 for the initial update and creation of config files. RUN \ diff --git a/startJD2.sh b/startJD2.sh index 99c32c9..8913f33 100755 --- a/startJD2.sh +++ b/startJD2.sh @@ -9,7 +9,10 @@ function stopJD2 { trap stopJD2 EXIT -java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar & +# Add a user to run the jdownloader +useradd -M --uid $UID --gid $GID jduser + +su jduser -c 'java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &' while true; do sleep inf