我正在使用 Fedora 17,在过去的几天里我的系统遇到了问题。每当我尝试启动时,httpd
它都会向我显示:
Error: No space left on device
当我执行时systemctl status httpd.service
,我收到以下输出:
httpd.service - The Apache HTTP Server (prefork MPM)
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: inactive (dead) since Tue, 19 Feb 2013 11:18:57 +0530; 2s ago
Process: 4563 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/httpd.service
我尝试用谷歌搜索这个错误,所有链接都指向清除信号量。我不认为这是问题,因为我尝试清除信号量,但没有成功。
编辑1
这是输出df -g
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 50G 16G 32G 34% /
devtmpfs 910M 0 910M 0% /dev
tmpfs 920M 136K 920M 1% /dev/shm
tmpfs 920M 1.2M 919M 1% /run
/dev/mapper/vg-lv_root 50G 16G 32G 34% /
tmpfs 920M 0 920M 0% /sys/fs/cgroup
tmpfs 920M 0 920M 0% /media
/dev/sda1 497M 59M 424M 13% /boot
/dev/mapper/vg-lv_home 412G 6.3G 385G 2% /home
这是 httpd 错误日志的详细信息
[root@localhost ~]# tail -f /var/log/httpd/error_log
[Tue Feb 19 11:45:53 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 19 11:45:53 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Feb 19 11:45:53 2013] [notice] Digest: done
[Tue Feb 19 11:45:54 2013] [notice] Apache/2.2.23 (Unix) DAV/2 PHP/5.4.11 configured -- resuming normal operations
[Tue Feb 19 11:47:23 2013] [notice] caught SIGTERM, shutting down
[Tue Feb 19 11:48:00 2013] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Feb 19 11:48:00 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 19 11:48:00 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Feb 19 11:48:00 2013] [notice] Digest: done
[Tue Feb 19 11:48:00 2013] [notice] Apache/2.2.23 (Unix) DAV/2 PHP/5.4.11 configured -- resuming normal operations
tail: inotify resources exhausted
tail: inotify cannot be used, reverting to polling
编辑2
这是输出df-i
[root@localhost ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 3276800 337174 2939626 11% /
devtmpfs 232864 406 232458 1% /dev
tmpfs 235306 3 235303 1% /dev/shm
tmpfs 235306 438 234868 1% /run
/dev/mapper/vg-lv_root 3276800 337174 2939626 11% /
tmpfs 235306 12 235294 1% /sys/fs/cgroup
tmpfs 235306 1 235305 1% /media
/dev/sda1 128016 339 127677 1% /boot
/dev/mapper/vg-lv_home 26984448 216 26984232 1% /home
谢谢
答案1
在这里我们看到了一个问题的证据:
tail: inotify resources exhausted
默认情况下,Linux 只为 inotify 分配 8192 个监视点,这个值低得离谱。当它用完时,错误也是No space left on device
,如果您没有明确寻找这个问题,这可能会令人困惑。
使用适当的 sysctl 提高该值:
fs.inotify.max_user_watches = 262144
(将此添加到/etc/sysctl.conf
然后运行sysctl -p
。)