0

in order to be able to start my application at boot time i have followed the Upstart instruction.

I have create a file /etc/init/poolparty.conf, within which i have defined the following:

# poolparty - poolparty job file

# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [016]

# Automatically restart process if crashed
respawn

# Essentially lets upstart know the process will detach itself to the background
expect fork

# Run before process
pre-start script
    [ -d /var/run/poolparty ] || mkdir -p /var/run/poolparty
    echo "starting Poolparty"
end script

# Start the process
exec /opt/poolparty/bin/poolparty start

This is an application that needs the network started, the multi-usermode started. In any case, whatever the machine needs to start first need to be there. It can be started at the end of the boot process.

However when i reboot, nothing happens.

What else do i need to do to start it ? Can someone help ?

When i type service poolparty start, i either get that the service is already started or nothing. In any case it does not work i checked it.

So if any one could guide me here that would be great. I would like to check the log as well.

Btw /opt/poolparty/bin/poolparty is an executable script, that set things and call a java application. It uses jsvc64 to start a java application based on Tomcat.

muru
  • 207,228

1 Answers1

1

As you are saying it require network and you are creating new directory so it need local-filesystem also .so you have to use

start on (local-filesystems and net-device-up IFACE!=lo)

or

start on (local-filesystem and started networking)

instead of

start on runlevel [2345]

and you can try

if [ ! -e /var/run/poolparty ]; then
     /bin/mkdir  /var/run/poolparty
   fi

instead of

  [ -d /var/run/poolparty ] || mkdir -p /var/run/poolparty
        echo "starting Poolparty"

suggestion : see upstart log under /var/log/upstart that will help you where you are missing. and also check syntax error of init script using command:

init-checkconf -d /etc/init/poolparty.conf  

and for better understanding of upstart script see Upstart Ubuntu cookbook

pl_rock
  • 11,715