Linux - inittab

linux
upstart

http://dustin.sallings.org/2010/02/28/running-processes.html
https://www.lifewire.com/inittab-linux-command-4095566
http://www.computerworld.com/article/2693438/unix-how-to-the-linux-etc-inittab-file.html
http://www.unixmantra.com/2013/04/syntax-for-etc-inittab.html
https://docs.oracle.com/cd/E19683-01/817-3814/6mjcp0qgh/index.html
http://www.tldp.org/LDP/sag/html/config-init.html
http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html
http://osr507doc.xinuos.com/en/OSAdminG/sstT.chg_inittab.html
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.files/inittab.htm

/etc/inittab:

#id:runlevel:action:process

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
respawn
exec /opt/portal/daemon-example.py start
description "Manage the bqm processes and the submitter processes"
author "Khai Doan"
start on runlevel [3]
exec /download/SRM/submitters/startQueuesManager.sh

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