From 0d958ee211a0e7bb364a7d4192e7ff2e85fa9a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJustin?= <“jmeacham@affinipay.com”> Date: Mon, 8 May 2017 16:58:11 -0500 Subject: [PATCH] Removing sudo from upstart script. --- templates/zookeeper.conf.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/zookeeper.conf.j2 b/templates/zookeeper.conf.j2 index 9b493c4..1070692 100644 --- a/templates/zookeeper.conf.j2 +++ b/templates/zookeeper.conf.j2 @@ -13,5 +13,7 @@ umask 007 kill timeout 300 script - exec sudo -u zookeeper -g zookeeper {{zookeeper_dir}}/bin/zkServer.sh start-foreground > /var/log/zookeeper/init-zookeeper.log 2>&1 + # https://superuser.com/questions/213416/running-upstart-jobs-as-unprivileged-users + exec su -s /bin/sh -c 'exec "$0" "$@" &>>/var/log/zookeeper/init-zookeeper.log' zookeeper -- \ + {{zookeeper_dir}}/bin/zkServer.sh start-foreground end script