首页 \ 问答 \ linux中的关机命令有哪些?

linux中的关机命令有哪些?

我们老师给我们留作业,让我们在linux中用cron做每天晚上12点定时关机的作业,起先我以重启代替关机,看看命令受否正确,我是这样做的:     #crontab -e      00 0 * * * reboot 结果证明我的命令是对的,但是,当我把reboot换成halt关机时,就停在一个全是英文界面的地方不动了,这到底是怎么回事?我的关机命令打错了么?如果错了,那我应该用哪个命令呢?我曾试过把halt换成init 0,但是也不行,拜托各位帮帮忙吧。
更新时间:2023-12-16 06:12

最满意答案

设置 nginx 和 php-fpm 的 Max open files 数量方法如下:

一、、由于使用 setuid 方式并不会通过 PAM ,所以 nginx 提供了 worker_rlimit_nofile 选项来自己定制 worker 的 Max open files 数量,比如,在 nginx.conf 中添加全局参数:worker_rlimit_nofile 65535;
二、、同样的,php-fpm 也有类似的参数 rlimit_files 只需要在 /etc/php5/fpm/php-fpm.conf 文件中添加该参数:
INI

rlimit_files = 65535

即可设置 nginx 和 php-fpm 的 Max open files 数量。
三、、以下为一些扩展信息:

1、在 limits.conf 的 man 页面就说明:

limits.conf – configuration file for the pam_limits module

2、同时,在 pam_limits 的 man 页面也说明:

The pam_limits PAM module sets limits on the system resources that can be obtained in a user-session

……

The module must not be called by a multithreaded application.

3、至此,/etc/security/limits.conf 不能设定守护进程的 Max open files 数量已经显而易见了。

其他回答

搜一下:如何设置 nginx 和 php-fpm 的 Max open files 数量

相关问答

更多
  • 设置 nginx 和 php-fpm 的 Max open files 数量方法如下: 一、、由于使用 setuid 方式并不会通过 PAM ,所以 nginx 提供了 worker_rlimit_nofile 选项来自己定制 worker 的 Max open files 数量,比如,在 nginx.conf 中添加全局参数:worker_rlimit_nofile 65535; 二、、同样的,php-fpm 也有类似的参数 rlimit_files 只需要在 /etc/php5/fpm/php-fpm. ...
  • 它似乎只需要一点点计算。 由于我有8个可用内核,因此可以生成更多的nginx工作进程: nginx.conf worker_processes 4; events { worker_connections 1024; } 而16gb的ram将为静态数量的php-fpm工作人员提供一些空间。 PHP-fpm.conf pm = static pm.max_children = 4096 Nginx fastcgi设置保持不变。 当设置发生变化时,我可能会稍微调整一下,可接受的并发性在服务器负载下降 ...
  • 这应该修复它... 你有: fastcgi_buffers 4 256k; 将其更改为: fastcgi_buffers 256 16k; //总共4096k 还设置fastcgi_max_temp_file_size 0 ,这将禁用缓冲到磁盘如果回复开始超越您的fastcgi缓冲区。 This should fix it... You have: fastcgi_buffers 4 256k; Change it to: fastcgi_buffers 256 16k; // 4096k total Al ...
  • 如果有人通过遇到同样的问题找到这个页面,我在这里找到答案: http : //www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp -酮的ubuntu-12.04-LTS 对于那些不能打扰点击并为自己工作的人...) 条件: 使用NGINX和PHP 5.3的Ubuntu或Debian服务器工作正常,但将PHP升级到5.4会给出502错误网关错误。 寻找在端口9000上运行的服务(通常运行netstat ...
  • 从昨天开始我一直在搞乱它,看起来它实际上是输出缓冲的一个错误。 在尝试了一切,阅读所有内容,疯狂之后,我终于关闭了输出缓冲,它运行良好。 我在这里提交了一份错误报告。 对于那些不知道的人,输出缓冲是php.ini中的一个设置,它阻止php在收到输出后立即通过线路发送输出。 不是一个完全关键的功能。 我把它从4096切换到了Off: ;php.ini: ... ;output_buffering = 4096 output_buffering = Off ... 希望这有助于其他人! I've been m ...
  • 这个配置工作:) server { listen 80; server_name _; index index.php; rewrite_log on; root /var/www/html; location / { try_files $uri /public/index.php$is_args$args; } location ^~ /api { try_files $uri /api/in ...
  • 我认为你的问题是你没有告诉nginx Symfony在哪里。 我已经举了一个我正在使用的nginx配置的例子。 server { listen 80; server_name example.com; chunked_transfer_encoding on; proxy_buffering off; charset utf-8; root /home/mpurcell/projects/j1n/app/example/current/code/web; access_lo ...
  • 从PHP 5.5.12开始,更改FPM套接字权限以解决与安全相关的错误,您可以在此处阅读更多相关信息 - > https://bugs.php.net/bug.php?id=67060 您的listen.mode = 0660现在应该在您的FPM池配置中设置为listen.mode = 0666 。 还要确保您的listen.owner和listen.group与运行Nginx的用户名/组相同。 这是我在设置中的内容: listen.owner = nginx listen.group = nginx li ...
  • 该错误表明您的SCRIPT_FILENAME不正确。 你的评论: 在wordpress容器中,位于/ app / nginx容器中的/var/www/html/index.php 建议nginx和php-fpm看到不同的文档根目录。 在这种情况下,使用: fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; The error indicates that your SCRIPT_FILENAME is incorrect. ...
  • 那太奇怪了。 这可能不是一个答案,但这里有太多的文字,以适应一个小评论框。 1)错误肯定来自PHP-FPM,并不是缓存问题。 错误消息来自: http : //lxr.php.net/xref/PHP_5_5/sapi/fpm/fpm/fpm_main.c#1920,因为PHP无法打开脚本。 显然, zlog错误会写入stderr PHP日志 - 您已将其设置为/var/log/php-fpm/www-error.log。 那里有什么吗? 如果不是,您可能需要重新编译PHP,或调整日志设置以找出错误。 2) ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。