Tom
Tom

Reputation: 29

How to auto-run my scala app in the Play framework on Linux upon server reboot?

all. I'm not even a newbie -- I'm a sub-newbie. We have a tool running in Linux written in Scala using the Play framework. I'm light on my Linux experience and have zero experience with Play or Scala.

The app crashed the other day and when we rebooted the server we hoped it would auto-restart the app. Alas, it did not. I finally figured out where the app was, what it was written in, and how to get it running.

The problem is it is only running in my terminal window and, of course, when I logout the app will stop running.

Question: how do I get it to auto-run when the server is rebooted? The command I use when running it in my terminal window is from the root directory of the app with this command: play run

It's Amazon Linux (https://aws.amazon.com/amazon-linux-ami/2015.03-release-notes), play! 2.1.1 (using Java 1.7.0_79 and Scala 2.10.0).

Thank you.

Upvotes: 2

Views: 633

Answers (1)

Mon Calamari
Mon Calamari

Reputation: 4463

All you need is sbt-native-packager. It will create unix package from your Play app. Upon installation, your app will be installed as service - it will start on boot.

Upvotes: 1

Related Questions