使用init.d脚本启动命令和服务启动之间的区别 [英] Difference between starting a command using init.d script and service start
问题描述
我需要了解使用 init.d
脚本和服务启动
启动命令之间的区别。 p>
例如
之间的区别是什么? /etc/init.d/nginx start
和服务nginx开始
。
他们做同样的事情,除了 service
在受控环境中运行脚本。从服务(8)手册页:
服务以尽可能可预测的环境运行System V初始化脚本,删除大多数环境变量和当前
工作目录设置为/
。
ENVIRONMENT
LANG
,TERM
唯一的环境变量传递到init脚本。
I need to understand the difference between starting a command using init.d
script and service start
.
For example what is the difference between
/etc/init.d/nginx start
and service nginx start
.
They do the same thing except service
runs the script in a controlled environment. From the service(8) man page:
DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to
/
.ENVIRONMENT
LANG
,TERM
The only environment variables passed to the init scripts.
这篇关于使用init.d脚本启动命令和服务启动之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!