How to write a service script ?
来源:百度文库 编辑:神马文学网 时间:2024/04/19 14:32:42
Service script is used to start a service when system booting up. It should be placed under /etc/init.d .
chkconfig is used to install a service script into different runlevels or remove it from certain runlevels. With --list option it can also let you find out certain service script will be started up in certain runlevels.
Service script must include at least two comment lines which are instructions to chkconfig. Fail to do so will let chkconfig complain about "service xxxx doesn‘t support chkconfig". To cite the man page of chkcnfig:
Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list.
The second line contains a description for the service, and may be extended across multiple lines with backslash continuation.
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80. You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored.
chkconfig is used to install a service script into different runlevels or remove it from certain runlevels. With --list option it can also let you find out certain service script will be started up in certain runlevels.
Service script must include at least two comment lines which are instructions to chkconfig. Fail to do so will let chkconfig complain about "service xxxx doesn‘t support chkconfig". To cite the man page of chkcnfig:
Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list.
The second line contains a description for the service, and may be extended across multiple lines with backslash continuation.
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80. You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored.
How to write a service script ?
How to Write a Spelling Corrector
How to Write a Book Report
How to Write a Book Report
How to Write a Good Recommendation
如何写一篇论文(How to write a thesis)
How to write a Scrollable Data Grid in WPF?
如何写一篇论文(How to write a thesis)
如何写一篇论文(How to write a thesis)
如何写一篇论文(How to write a thesis)
How to write a creative brief, with sample br...
How To Write A Novel Using The Snowflake Method
如何写一篇论文(How to write a thesis) - 阮一峰的网络日志
如何写一篇论文(How to write a thesis) - 阮一峰的网络日志ll
【牛津大学汉语教学资源】How to Write Chinese Characters(包...
How to find a file?
How To Compile A Kernel
How to Start a Startup
how to read a paper
How to read a book!!!
how to make a sop
How to Propose a Toast
ExcelADO demonstrates how to use ADO to read and write data in Excel workbooks
Matlab Attempt to execute SCRIPT*as a functionc错误