Legacy startup script procedure

p { margin-bottom: 0.08in; }

This procedure is commonly used on System 5 implementations such as SOLARIS, HPUX, AIX, LINUX.

Although this setup procedure will work on all Unix systems, care should be taken as to ascertain the native startup scheme for the OS you are working with. Usually the OS has a native interface to that aspect of it’s infrastructure :

HPUX = SAM
AIX = SMITH
SOLARIS = SVC
LINUX = Determined by choice of flavour and support applications.

In this exercise, we are using the OS independent Berkely setup. This setup uses the:

Script depository directory /etc/init.d
The startup shutdown hierarchy directrories /etc/rc.d/rc#.d

For illustration purposes, we will use a common feature application such as httpd.

Here is an example of the httpd startup script (see addenda 1) that is usually installed in the /etc/init.d directory when the webserver is installed. Sometimes, that startup scritp may be installed directly in the application directories. A link to the application startup script should be done from there if needed.

Notice that the script has several parameters that are usually “start, stop, restart, status, other…” this is common for a startup script. Should you execute the command line :
/etc/init.d/httpd stop
this would effectively tell the script to execute the code that would stop the current running httpd daemon and the access to the port 80 or other implied would cease.
/etc/init.d/httpd start
would restart it.

System 5 implementation use the rc and rc.sysinit system startup scripts that will read the /etc/rc.d directory hierarchy and locate links that have the forme of :
/etc/rc.d/rc3.d/S85httpd -> ../init.d/httpd and /etc/rc.d/rc3.d/K85httpd -> ../init.d/httpd

Notice the S and K at the beginning of the link and the 85 after it.
The
S entry in the rc3.d directory is there to tell the system to Start at sequence number 85 the script /etc/init.d/httpd after all other scripts in other rc2.d, rc1.d, rc0.d have been executed. The number 85 is arbitrary to the rc#.d directory and tells the rc script to start that numbered script after the lower numbers in that directory have been dealt with. A K entry would tell the system to kill the process and all other processes associated according to the code in the startup script in the same manner.

So to startup the httpd daemon at system boot you would do this :

  1. Install httpd as per instruction.

  2. Make sure that the startup script “httpd” is present, available and executable, should have “ -rwxr-xr-x ” permissions 0755 with user root and group root.

  3. Copy the httpd script in the /etc/init.d directory if not already there.

  4. Execute the command find /etc -name “*http*” –ls to make sure that the S or K entries do not already exist.

  5. Cd to /etc/rc.d/rc3.d

  6. Use the command ln –s /etc/init.d/httpd S85httpd

  7. It is wise to add a –s /etc/init.d/httpd K##httpd with a smaller number that the startup sequence to make sure that all associated files and dependencies are closed or stopped before starting a process.

  8. At reboot, the system will start httpd after all preceding processes are done.

 

p { margin-bottom: 0.08in; }

Httpd startup script

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值