当我启动 Ubuntu 16.04 安装时,我收到消息“无法启动应用内核变量”。除了该错误消息之外,启动过程运行顺利,我能够成功访问操作系统。大部分情况下一切似乎都运行正常。但是,我过去曾被锁定在系统之外,不得不从启动菜单中清除大量内容才能访问操作系统。此外,我的安装在保存的显示设置方面存在一些问题。
“无法启动应用内核变量”我很好奇这是什么意思。有办法修复这个问题吗?
这是我运行 FYI 时的输出,sudo systemctl status systemd-sysctl.service
我是一个新的 Linux/Ubuntu 用户
systemd-sysctl.service - Apply Kernel Variables
Loaded: loaded (/lib/systemd/system/systemd-sysctl.service; static;
vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-05-15 07:35:45 PDT; 3h 53min ago
Docs: man:systemd-sysctl.service(8)
man:sysctl.d(5)
Process: 817 ExecStart=/lib/systemd/systemd-sysctl (code=exited,status=1/FAILURE)
Main PID: 817 (code=exited, status=1/FAILURE)
May 15 07:35:45 ubuntu systemd[1]: Starting Apply Kernel Variables...
May 15 07:35:45 ubuntu systemd-sysctl[817]: Line is not an assignment in file '/etc/sysctl.d/99-sysctl.conf': (null)
May 15 07:35:45 ubuntu systemd[1]: systemd-sysctl.service: Main process exited, code=exited, status=1/FAILURE
May 15 07:35:45 ubuntu systemd[1]: Failed to start Apply Kernel Variables.
May 15 07:35:45 ubuntu systemd[1]: systemd-sysctl.service: Unit entered failed state.
May 15 07:35:45 ubuntu systemd[1]: systemd-sysctl.service: Failed with result 'exit-code'.
以下是输出cat /etc/sysctl.d/99-sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
root soft nofile 10000
root hard nofile 12800
www-data soft nofile 10000
www-data hard nofile 12800
提前感谢您的见解!
答案1
sysctl.conf 文件的最后 4 行
root soft nofile 10000
root hard nofile 12800
www-data soft nofile 10000
www-data hard nofile 12800
应该在另一个位置。将这些行从 中删除/etc/sysctl.conf
,或在每行前放置#
,然后尝试/etc/security/limits.conf
按照 中的建议将这些限制放在 中Ubuntu 14.04:非 root 用户无法超过 4096 个最大打开文件数,Ubuntu 14.04 LTS 上的 nofile ulimit -n和https://serverfault.com/questions/165316/how-to-configure-linux-file-descriptor-limit-with-fs-file-max-and-ulimit
此外,您可能需要编辑/etc/pam.d/common-session
并将以下行添加到末尾:
session required pam_limits.so