查看“Debian rc.local 开机启动问题”的源代码
←
Debian rc.local 开机启动问题
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=debian10= <pre> cat <<EOF >/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 EOF chmod +x /etc/rc.local systemctl daemon-reload systemctl start rc-local systemctl status rc-local </pre> https://stackoverflow.com/questions/44797694/where-is-rc-local-in-debian-9-debian-stretch#44801337 =Question= leanote 没有做成规范的启动脚本 所以 得加到开机自启动 于是想到 rc.local =Solution= <pre> #一定得加这个启动文件 不然是不行的 cat > /etc/systemd/system/rc-local.service <<EOF [Unit] Description=/etc/rc.local ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target EOF cat <<EOF >/etc/rc.local #!/bin/bash # 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 EOF chmod +x /etc/rc.local systemctl enable rc-local systemctl start rc-local </pre> =trouble shooting= <pre> #cat /etc/rc.local #这个会导致ssh起不来 可能是因为 有交互内容吧 /data/apps/leanote/bin/run.sh #这个就可以正常启动了哦 /usr/bin/nohup /data/apps/leanote/bin/run.sh & </pre> [[category:debian]]
返回至
Debian rc.local 开机启动问题
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
我的导航
关于我
shell
python
ops
linuxchina.net
blog.linuxchina
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息