• 友链

  • 首页

  • 文章归档
h u a n b l o g
h u a n b l o g

欢

HI,Friend

06月
12
Linux

Centos7中开机不执行.md

发表于 2021-06-12 • 字数统计 909 • 被 1,509 人看爆

为Linux启动脚本中添加一些命令,让博客开机自启,添加过后发现无论如何重启服务器,博客都没有启动,最后发现是:/etc/rc.d/rc.local没有执行权限

在/etc/rc.local文件内容中发现了问题的原因了:

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In constrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

翻译:

#这个文件是为了兼容性的问题而添加的。
#
#强烈建议创建自己的systemd服务或udev规则来在开机时运行脚本而不是使用这个文件。
#
#与以前的版本引导时的并行执行相比较,这个脚本将不会在其他所有的服务后执行。
#
#请记住,你必须执行“chmod +x /etc/rc.d/rc.local”来确保确保这个脚本在引导时执行。

发现是/etc/rc.d/rc.local没有执行权限 于是按要求执行了下chmod +x /etc/rc.d/rc.local 重启后发现/etc/rc.local能够执行,博客也正常启动了

转载自:https://www.sqms.xyz/archives/test

分享到:
Certbot 添加证书
  • 文章目录
  • 站点概览
欢

网红 欢

你能抓到我么?

Email RSS
看爆 Top5
  • mac系统版本与Xcode版本有冲突 4,080次看爆
  • JAVA_HOME环境配置问题 3,731次看爆
  • AssetBundle使用 3,499次看爆
  • VSCode配置C++开发环境 3,257次看爆
  • Lua反射 3,133次看爆

Copyright © 2025 欢 粤ICP备2020105803号-1

由 Halo 强力驱动 · Theme by Sagiri · 站点地图