首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >‘$/sbin/restart nginx’和‘$service nginx restart’之间有什么区别?

‘$/sbin/restart nginx’和‘$service nginx restart’之间有什么区别?
EN

Stack Overflow用户
提问于 2020-05-21 19:02:50
回答 1查看 363关注 0票数 1

我希望在增加nginx中的文件描述符限制后重新启动/etc/security/limits.d/nginx.conf,并且需要重新启动nginx进程以使更改生效。

我应该使用$/sbin/restart nginx还是$service nginx restart,区别是什么?

作为参考,/sbin/restart是什么:

代码语言:javascript
复制
$ /sbin/restart --help
Usage: restart [OPTION]... JOB [KEY=VALUE]...
Restart job.

Options:
  -n, --no-wait               do not wait for job to restart before exiting
      --system                use D-Bus system bus to connect to init daemon
      --dest=NAME             destination well-known name on system bus
  -q, --quiet                 reduce output to errors only
  -v, --verbose               increase output to include informational messages
      --help                  display this help and exit
      --version               output version information and exit

JOB is the name of the job that is to be restarted, this may be followed by zero or more environment variables to be defined in the job after
restarting.

The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be restarted.

Report bugs at <https://launchpad.net/upstart/+bugs>
EN

回答 1

Stack Overflow用户

发布于 2020-05-21 19:07:35

使用sbin/nginx,您可以直接向nginx发送命令。

服务也这样做(检查屏幕截图):

在我的ubuntu服务器上,我没有/sbin/restart,如果您有它,请尝试执行cat /sbin/restart

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61941950

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档