Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstart/init.d scripts should all run as shiny user #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/init.d/debian/shiny-server
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="shiny server"
NAME=shiny-server
DAEMON=shiny-server
DAEMON=/usr/bin/shiny-server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will not work under debian, where the install is in /usr/local/bin/. I guess DAEMON=which shiny-server`` is preferable.

SCRIPTNAME=/etc/init.d/shiny-server

# Exit if the package is not installed
Expand All @@ -40,9 +40,9 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --background --exec $DAEMON --test > /dev/null \
start-stop-daemon --start --quiet --background --user shiny --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --background --exec $DAEMON \
start-stop-daemon --start --quiet --background --user shiny --exec $DAEMON \
|| return 2
}

Expand Down
2 changes: 1 addition & 1 deletion config/init.d/redhat/shiny-server
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
start() {
touch $logfile
echo -n "Starting shiny-server: "
daemon $prog >> $logfile &
daemon --user shiny $prog >> $logfile &
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
Expand Down
2 changes: 1 addition & 1 deletion config/init.d/suse/shiny-server
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case "$1" in

## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
/sbin/startproc shiny-server
/sbin/startproc -u shiny shiny-server

# Remember status and be verbose
rc_status -v
Expand Down
2 changes: 1 addition & 1 deletion config/upstart/shiny-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ stop on runlevel [016]

limit nofile 1000000 1000000

exec shiny-server >> /var/log/shiny-server.log 2>&1
exec start-stop-daemon --start -c shiny --exec /usr/bin/shiny-server >> /var/log/shiny-server.log 2>&1

respawn