(OK) Fedora 24 开机自动启动脚本 - rc.local - rc-local.service


vim /etc/rc.d/rc.local

#!/bin/bash

systemctl start docker.service

/root/hsl-win7-ns3-root.sh 6 destroy
/root/hsl-win7-ns3-root.sh 6 destroy

/root/hsl_install_6_docker-centos-quagga.sh destroy
/root/hsl_install_6_docker-centos-quagga.sh destroy

/root/hsl-win7-ns3-root.sh 6 create
/root/hsl_install_6_docker-centos-quagga.sh create

chmod +x /etc/rc.d/rc.local

vim /usr/lib/systemd/system/rc-local.service

#  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.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes

systemctl enable rc-local.service
systemctl status rc-local.service













posted @   张同光  阅读(169)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示