[med-svn] [shiny-server] 01/01: Fix systemd control script, do not set LANG in the hope that the system does it correctly itself

Andreas Tille tille at debian.org
Fri Mar 24 14:38:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository shiny-server.

commit 3d2264eee055b16e82a9bf8f5bd91c2624c05f72
Author: Andreas Tille <tille at debian.org>
Date:   Fri Mar 24 15:27:38 2017 +0100

    Fix systemd control script, do not set LANG in the hope that the system does it correctly itself
---
 debian/install              |  5 +++--
 debian/postinst             | 33 ---------------------------------
 debian/shiny-server.service | 19 +++++++++++++++++++
 3 files changed, 22 insertions(+), 35 deletions(-)

diff --git a/debian/install b/debian/install
index 8208452..e8685d5 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1,3 @@
-config/init.d/debian/*				etc/init.d
-config/*.config					etc/shiny-server
+config/init.d/debian/*		etc/init.d
+config/*.config			etc/shiny-server
+debian/shiny-server.service	lib/systemd/system
diff --git a/debian/postinst b/debian/postinst
index f2a6493..2940eba 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -31,37 +31,4 @@ mkdir -p /var/log/shiny-server
 # Log dir must be writable by "shiny" user
 chown shiny:shiny /var/log/shiny-server
 
-# check lsb release
-LSB_RELEASE=`lsb_release --id --short`
-
-# # add apparmor profile
-# if test $LSB_RELEASE = "Ubuntu" && test -d /etc/apparmor.d/
-# then
-#    cp /usr/lib/extras/apparmor/rstudio-server /etc/apparmor.d/
-#    apparmor_parser -r /etc/apparmor.d/rstudio-server 2>/dev/null
-# fi
-
-# Ubuntu needs help setting LANG which we'll do in the Upstart script by 
-# injecting it into the script here.
-if [ -e /etc/default/locale ]; then
-   . /etc/default/locale
-fi
- if [ $LANG ] && [ "$LANG" != "C" ]; then
-   # $LANG exists and is set. Just use it
-   SS_LANG=$LANG
-else 
-   # $LANG is not set, we need to infer it.
-   if (locale -a | grep -e '^C.UTF-8$' > /dev/null); then
-      # We have C.UTF-8, use it.
-      SS_LANG="C.UTF-8"
-   else 
-      SS_LANG="en_US.UTF-8"
-   fi
-fi
-
-if ! grep -e "^Environment=\"LANG=" /etc/systemd/system/shiny-server.service; then
-  echo "Adding LANG to /etc/systemd/system/shiny-server.service, setting to $SS_LANG"
-  sed -i "11 a Environment=\"LANG=$SS_LANG\"" /etc/systemd/system/shiny-server.service
-fi
-
 #DEBHELPER#
diff --git a/debian/shiny-server.service b/debian/shiny-server.service
new file mode 100644
index 0000000..7d07900
--- /dev/null
+++ b/debian/shiny-server.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=ShinyServer
+
+[Service]
+TimeoutStartSec=10
+ExecStart=/bin/bash -c '/usr/bin/shiny-server --pidfile=/var/run/shiny-server.pid >> /var/log/shiny-server.log 2>&1'
+# Needed to give SS a chance to write out to the PID file.
+ExecStartPost=/bin/sleep 3
+PIDFile=/var/run/shiny-server.pid
+Type=simple
+
+# Environment="LANG=en_US.UTF-8"
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStopPost=/bin/sleep 5
+RestartSec=1
+
+
+[Install]
+WantedBy=multi-user.target

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/shiny-server.git



More information about the debian-med-commit mailing list