How to start an application at boot time or as a service

MaatDeamon

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.

pl_rock

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] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Run 'sudo service mongod start' at boot time

분류에서Dev

How do I make my systemd service run via specific user and start on boot?

분류에서Dev

How to start a script file on boot?

분류에서Dev

How to start a service from a service on android?

분류에서Dev

Boot-time service startup messages are repeated a second time

분류에서Dev

How to start GUI application with upstart?

분류에서Dev

Change linux service to start in namespace on boot instead of just starting normal

분류에서Dev

Confused why systemd service doesn't start at boot

분류에서Dev

How to get the boot time of Ubuntu?

분류에서Dev

How to get Windows boot time?

분류에서Dev

How to get Windows boot time?

분류에서Dev

How do I start the mariadb service on NixOS?

분류에서Dev

How to start the OpenVPN client service on Ubuntu 15.04

분류에서Dev

How to create a service to start my mariadb?

분류에서Dev

How to start a service in linux after running command not at start of the system?

분류에서Dev

Run Boot time commands in AWS Elastic Container Service(ECS) instances

분류에서Dev

Disabling ntp.service for the boot, since it takes a long time

분류에서Dev

How to start an application with bottom most property?

분류에서Dev

How to start an application with bottom most property?

분류에서Dev

How to start an application Maximized using a .bat file?

분류에서Dev

How to create a survival time variable based on start and stop time

분류에서Dev

How to enable numlock at boot time for login screen?

분류에서Dev

How the modules are loaded at boot time? And what is the order in which they loaded at boot time? How to change it?

분류에서Dev

How to start teamspeak 3 on boot, ubuntu server 12.04

분류에서Dev

How to start command on boot in Fedora 26 to reverse scroll mouse?

분류에서Dev

간단한 Spring Boot 앱에서 "APPLICATION FAILED TO START"오류 발생

분류에서Dev

Very slow boot time ubuntu - A start job is running for Raise network interfaces

분류에서Dev

How to read excel file on a Java-Web Start Application

분류에서Dev

How to create variables that indicate start and end periods in a time series in R

Related 관련 기사

  1. 1

    Run 'sudo service mongod start' at boot time

  2. 2

    How do I make my systemd service run via specific user and start on boot?

  3. 3

    How to start a script file on boot?

  4. 4

    How to start a service from a service on android?

  5. 5

    Boot-time service startup messages are repeated a second time

  6. 6

    How to start GUI application with upstart?

  7. 7

    Change linux service to start in namespace on boot instead of just starting normal

  8. 8

    Confused why systemd service doesn't start at boot

  9. 9

    How to get the boot time of Ubuntu?

  10. 10

    How to get Windows boot time?

  11. 11

    How to get Windows boot time?

  12. 12

    How do I start the mariadb service on NixOS?

  13. 13

    How to start the OpenVPN client service on Ubuntu 15.04

  14. 14

    How to create a service to start my mariadb?

  15. 15

    How to start a service in linux after running command not at start of the system?

  16. 16

    Run Boot time commands in AWS Elastic Container Service(ECS) instances

  17. 17

    Disabling ntp.service for the boot, since it takes a long time

  18. 18

    How to start an application with bottom most property?

  19. 19

    How to start an application with bottom most property?

  20. 20

    How to start an application Maximized using a .bat file?

  21. 21

    How to create a survival time variable based on start and stop time

  22. 22

    How to enable numlock at boot time for login screen?

  23. 23

    How the modules are loaded at boot time? And what is the order in which they loaded at boot time? How to change it?

  24. 24

    How to start teamspeak 3 on boot, ubuntu server 12.04

  25. 25

    How to start command on boot in Fedora 26 to reverse scroll mouse?

  26. 26

    간단한 Spring Boot 앱에서 "APPLICATION FAILED TO START"오류 발생

  27. 27

    Very slow boot time ubuntu - A start job is running for Raise network interfaces

  28. 28

    How to read excel file on a Java-Web Start Application

  29. 29

    How to create variables that indicate start and end periods in a time series in R

뜨겁다태그

보관