ubuntu18.04 启动失败,因为没有进入exit 0
/etc/rc.local 文件它只是停留在启动页面,不能进入系统。
#!/bin/bash
# do something just like echo log to file
exit 0
我确定 /etc/rc.local 文件运行,并得到一些错误。我该如何解决这个问题。
Ubuntu 和 Debian 系统上的 /etc/rc.local 文件用于在系统启动时执行命令。
所以让我们用你最喜欢的文本编辑器创建 /etc/rc.local 文件。
vim /etc/rc.local
复制并粘贴以下内容。
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
保存并退出
现在使它可执行。
chmod +x /etc/rc.local
就是这样。您现在可以使用此文件在系统启动时执行命令。
只需将您的命令粘贴到 exit 0 行上方
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句