1.) Create a executable file.
vi filename.
2.) Add the below content to the file
#!/bin/sh
#chkconfig: 2345 80 05
#description: my service
echo "starting up"
3.)Place the scrip in etc/init.d/rc.d
4.)Make it executable: chmod a+x filename
5.)add the filename to the executing sequence using: chkconfig --add filename
Notes:
Bios -- > Master Boot Record -- > Kernel -- >Init.
read linux about startup
to see the PID of init:
ps -ef | grep init
In short, the init performs tasks that are outlined in /etc/inittab.
The folders in etc/init.d/rc.d
/etc/rc.d. there are a set of files rc.0, rc.1, rc.2, rc.3, rc.4, rc.5, and rc.6,
the system uses these files (and/or directories) to control the services to be started.
Note: to see all the auto initializing scripts
type : chkconfig --list
startup sequence in init with chkconfig
No comments:
Post a Comment