Linux: How to write a System V init script to start, stop, and restart my own application or service

Linux: How to write a System V init script to start, stop, and restart my own application or service

by on September 19, 2006 · 17 comments· LAST UPDATED September 19, 2006

in , ,

System V (abbreviated as SysV) is most widely used across most Linux distributions. But what is System V?

Init is the program on Unix and Linux systems which spawns all other processes. It runs as a daemon and typically has PID 1. It is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab file. The main advantages is flexibility and scalability provided by SysV.

The Runlevels in System V describe certain states. For example:

  • Runlevel 0: Halt
  • Runlevel 1: Single user mode
  • Runlevel 6: Reboot

All System V init scripts are stored in /etc/rc.d/init.d/ or /etc/init.d directory. These scripts are used to control system startup and shutdown

more…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s