Couple of days back I created an instance in AWS with CentOS - MySQL - R - Shiny-Server. The shiny-server is a free version. I loaded my app, data into MySQL. My app ran without a glitche for two days. Since yesterday afternoon, I am getting a "Failed to connect: message" from Safari. When I explored I figured out why shiny-server got stopped, I got the following message:
systemctl status shiny-server -l
● shiny-server.service - ShinyServer
Loaded: loaded (/etc/systemd/system/shiny-server.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2016-06-29 02:51:11 UTC; 35s ago
Process: 3567 ExecStopPost=/usr/bin/sleep 5 (code=exited, status=0/SUCCESS)
Process: 3565 ExecStartPost=/usr/bin/sleep 3 (code=exited, status=0/SUCCESS)
Process: 3557 ExecStart=/usr/bin/bash -c /opt/shiny-server/bin/shiny-server --pidfile=/var/run/shiny-server.pid >> /var/log/shiny-server.log 2>&1 (code=exited, status=0/SUCCESS)
Main PID: 3276 (code=exited, status=0/SUCCESS)
Jun 29 02:51:03 ip-172-31-8-158.ap-southeast-1.compute.internal systemd[1]: Starting ShinyServer...
Jun 29 02:51:11 ip-172-31-8-158.ap-southeast-1.compute.internal systemd[1]: Started ShinyServer.
When i checked the /var/log/shiny-server.log i am getting the following error.
^[[32m[2016-06-29 02:51:03.902] [INFO] shiny-server - ^[[39mShiny Server v1.4.2.786 (Node.js v0.10.40)
^[[32m[2016-06-29 02:51:03.903] [INFO] shiny-server - ^[[39mUsing pidfile /var/run/shiny-server.pid
^[[32m[2016-06-29 02:51:03.904] [INFO] shiny-server - ^[[39mUsing config file "/etc/shiny-server/shiny-server.conf"
^[[31m[2016-06-29 02:51:03.940] [ERROR] shiny-server - ^[[39mError loading config: run_as directive appears too many times (/etc/shin$
^[[32m[2016-06-29 02:51:03.941] [INFO] shiny-server - ^[[39mShutting down worker processes
When I removed the comment on the PIDfile line got the following error:
Job for shiny-server.service failed because a configured resource limit was exceeded.
Going by examples here at SO i tried doing the following:
Commented out the line PIDfile=/var/run/shiny-server.pid
and changed the Type=forking
from simple
in the /etc/systemd/system/shiny-server.service file. Stop, start, restart shiny-server with commenting out, commenting in the pid file didn't seem to work.
Tried adding a link ln -s shiny-server.service /systemd/system/multi-user.target.wants
but got a message file already exits. Not sure how to start the server again.