ubuntu rc.local开机自启动
最编程
2024-07-06 17:48:15
...
https://blog.****.net/qq_48974566/article/details/137212295
sudo vim /lib/systemd/system/rc-local.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
#!/bin/sh
bash /home/robot/multi-lidar-perception/perception_start.sh 2>&1 >>/home/robot/test/test1.log &
return 0
启动服务
systemctl start rc-local.service
重启服务
systemctl restart rc-local
停止服务
systemctl stop rc-local.service
rc.local 服务使能 --> 开机依旧生效
systemctl enable rc-local.service
rc.local 禁用服务 --> 再次开机时会失效
systemctl disable rc-local.service
推荐阅读
-
Windows中的开机自启动方法
-
如何在CentOS 7上配置Tomcat 9开机自启动服务
-
一键完成!CentOS 7系统中安装 Tomcat 9 并实现开机自启动
-
在 CentOS 7 和 CentOS 8 的 RC.local 中,如何修复开机不自动执行的问题
-
在Ubuntu系统休眠后,遇到身份验证错误(开机启动问题)
-
ubuntu rc.local开机自启动
-
让软路由器开机自启动!
-
在 Ubuntu 22.04 上使用 systemctl 命令配置启动自启动服务、脚本和命令
-
Android】广播标准(无序)广播收听网络WiFi或移动数据改变状态(动态注册),实现APP开机自启动(静态注册)
-
华擎 B365 BIOS 为来电启动、来电自启动、来电后开机进行设置