Jetty 9 is installed on EC2 linux server, jetty.sh was copied to /etc/init.d and proper links made at /etc/rc1.d, /etc/rc2.d.
I'm connecting to the instance using SSH, and running jetty through sudo service jetty start
which loads the service correctly, even after logging out of the SSH session.
But when running a remote SSH command ssh -t -i key.pem ec2-user@instance.domain.com 'sudo service jetty restart'
on my instance, it starts but then stops right after. Here's the log:
2013-11-14 18:03:01 main DispatcherServlet [INFO] FrameworkServlet 'restapi': initialization completed in 1376 ms
2013-11-14 18:03:01.824:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@67fc3482{/,file:/usr/share/jetty/jetty-distribution-9.0.6.v20130930/webapps/ROOT/,AVAILABLE}{/ROOT}
2013-11-14 18:03:01.941:INFO:oejs.ServerConnector:main: Started ServerConnector@10614f3d{HTTP/1.1}{0.0.0.0:8080}2013-11-14 18:03:02.226:INFO:oejs.ServerConnector:main: Started ServerConnector@666c1838{SSL-http/1.1}{0.0.0.0:8443}2013-11-14 18:03:05.670:INFO:oejs.ServerConnector:Thread-3: Stopped ServerConnector@10614f3d{HTTP/1.1}{0.0.0.0:8080}
2013-11-14 18:03:05.671:INFO:oejs.ServerConnector:Thread-3: Stopped ServerConnector@666c1838{SSL-http/1.1}{0.0.0.0:8443}
I've tried executing remotely sudo nohup service jetty restart &
, same result.
How can I restart remotely (SSH) and keep it running?