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.
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
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다