Archive for the ‘Play’ Category

Startup script for Ubuntu

Posted: April 15, 2013 in EC2, Play, Ubuntu

When you need to start a service (like Glassfish or Play) in Ubuntu, you can take this script as a template:

#! /bin/sh
case "$1" in
        ... execute a shell script here ...
        ... execute a shell script here ...
        ... execute a shell script here ...
exit 0

Make sure to make your scripts executable. In order to get it running during startup, add a link to the init.d directory and register the service-script to make it run as first service (depends on your system which priority you assign, take care here, I just took 01 as an example) 

cd /etc/init.d
sudo ln -sf  ~/
sudo update-rc.d defaults 01 01

Reboot and you’ll see that your services get started.