Linux - inittab




runlevel: can contain any characters for different run level

action: respawn, wait, once, boot, bootwait, off, ondemand, intdefault, sysinit, 
    powerwait, powerfail, ctrlaltdel, kbrequest

is:3:intdefault    // set default run level
fs::bootwait:/etc/bcheckrc    </dev/console > /dev/console 2>&1
ro:056:wait:/etc/rc0 >/dev/console 2>&1 </dev/console

wait: start the process and wait for it to finish before going to the next entry
respawn: automatically restart the process when it dies
once: start the process if it's not already running
boot: only start the process at boot time
bootwait: execute the process at boot time and wait for it to finish
initdefault: specifies default run level
sysinit: used for activities that need to be performed before init tries to access system console
off: if process associated with this entry is running, kill it
powerfail: define action to execute during power failure
powerwait: define action to execute during power failure; init must wait.
powerokwait: define action to execute when power is restored.

init q

To add your daemon to Upstart, add a file such as /etc/init/daemon-example.conf with contents:

start on startup
exec /opt/portal/ start
description "Manage the bqm processes and the submitter processes"
author "Khai Doan"
start on runlevel [3]
exec /download/SRM/submitters/

To check the syntax of the configuration file:

init-checkconf /etc/init/testjob.conf

Amazon AMI does not seem to have the init-checkconf command for some reason.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License