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.

1 Answer 1

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

7
  • Thank you for the answer. The command needs to be run as root does it matter ? (/opt/poolparty/bin/poolparty start)
    – MaatDeamon
    Oct 6, 2015 at 5:59
  • i don't think so. most of init script run as root . refer askubuntu.com/questions/297992/…
    – pl_rock
    Oct 6, 2015 at 6:13
  • Yes actually i made it work with " start on (local-filesystems and net-device-up IFACE!=lo)" . Maybe what you try to write that is referred in the doc is "start on started network-services". I could not find in the doc "start on (local-filesystem and started networking)"
    – MaatDeamon
    Oct 6, 2015 at 7:13
  • In any case i have no specific requirements at the init of the machine. I just need everything to be up and start the Service.
    – MaatDeamon
    Oct 6, 2015 at 7:13
  • I also had to provide a Java_Home, as the service is a java application.
    – MaatDeamon
    Oct 6, 2015 at 7:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .