当前位置: 首页 > news >正文

麒麟系统安装后添加自启动

1. 在/etc/systemd/system/目录下新建文件rc-local.service

2.在文件中输入内容

#  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 publishe
d 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

其中/etc/rc.local,为你需要自启动的内容文件

3. 在/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.#your shell
#excample:/scu/autorun.shexit 0

其中/scu/autorun.sh是我设备需要运行的脚本,里面有驱动加载、应用程序等。

4. 在/scu/autorun.sh添加所需要运行的脚本或者程序。

5. 添加启动项

sudo chmod 775 /etc/rc.local
sudo systemctl enable rc-local
sudo systemctl start rc-local.service

http://www.dtcms.com/a/439220.html

相关文章:

  • 网站底部备案号悬挂佛山木工机械厂骏域网站建设专家
  • 顺序表专题
  • 网站 备案 中国 名字微网站模板代码
  • ASP.NET Core Web API 中控制器操作的返回类型及Swagger
  • AI模型测评平台工程化实战十二讲(第六讲:大模型测评系统:智能模型管理模块的设计与实现)
  • 手写MyBatis第90弹:动态SQL测试策略与验证方法
  • 比较有名的公司网站网站建设犀牛云
  • 网站备案 企业备案响应式博客wordpress
  • AI 重塑实体经济:2025 传统产业转型的南通实践启示
  • 番禺建设网站平台网站建设所需要的内容
  • 网站每年续费费用南通制作网站
  • 特优项目网站建设方案辽宁建设工程信息网开评标系统
  • 哪个网站可以做验证码兼职强 的软件免费的软件下载
  • IPV4/Ipv6公网检测网站, DDNS配置
  • 贵州省城乡和住房建设厅网站线上app怎么做
  • 地方网站推广云主机费用
  • QT肝8天13--删除用户
  • 素材分享网站源码北龙中网 可信网站验证 费用
  • P7226 [COCI 2015/2016 #3] POT
  • 网店代运营网站建设银行信用卡积分兑换话费网站
  • 数字资产离婚分割案:巨额数字资产归谁所有?
  • 网站源码安装教程阳江房产网站
  • 2.VMware上的Kali Linux操作系统安装(2025年10月3日)
  • 全志T113-S3开发板遇到的问题
  • 神卓云监控 K900:异地监控技术落地与方案优化实践
  • 东莞企业网站排名wordpress重置后密码是多少
  • 设计网站建设网站美化教程下载
  • 队列算法精讲:从栈与队列互实现到循环队列(待补充)
  • 蝴蝶优化算法:原理、改进与应用
  • 你会怎么做外国的网站建一个购物网站多少钱