惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 笨功夫才是真功夫

TortoiseSVN实现excel文件差异比对(集成ExcelMerge)[转] git仓库迁移 centos7.6 nginx配置ssl证书 在Debian12上安装mysql 8.0 Mysql8.0设置大小写不敏感解决方案[转] debian下常见问题 vue开发环境搭建 bash脚本的输入参数解析 python常用脚本 mysql数据库备份脚本 redis安装和运维 docker环境下安装RabbitMQ 在Windows10部署kibana Elasticsearch监控 Flink cdc实践(陆续更新) 在windows下安装mysql 8.1 VMware虚拟机开机自动启动 停止windows10的系统更新 elasticsearch安装-集群 elasticsearch安装-单实例
Linux系统设置开机启动(草稿)
笨功夫才是真功夫 · 2024-01-04 · via 博客园 - 笨功夫才是真功夫

Debian系统

验证未通过,发现每次都是写两次
且移除自启动并未成功

  1. 在/etc/init.d下新建test,内容如下

    #!/bin/sh
    
    ### BEGIN INIT INFO
    # Provides: test
    # Required-Start: $network $remote_fs $local_fs
    # Required-Stop: $network $remote_fs $local_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: test
    # Description: test的说明
    ### END INIT INFO
    
    #需要执行的命令,示例
    echo "Hello world!"  `date +"%Y-%m-%d %H:%M:%S"` >> /root/test.txt
    
    exit 0
    
    
  2. 设置为可运行

    chmod +x test
    
  3. 添加到开机启动

    update-rc.d test defaults
    #移除命令
    #update-rc.d -f test remove 
    
  4. 查看系统开机自动启动项目:

    service --status-all
    
  5. 标准文件格式说明

    #!/bin/sh
    
    ### BEGIN INIT INFO
    # Provides: [程序名称,唯一]
    # Required-Start: $network $remote_fs $local_fs
    # Required-Stop: $network $remote_fs $local_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: [启动项的简短说明]
    # Description: [启动项的完整说明]
    ### END INIT INFO
    
    [需要执行的命令]
    
    exit 0
    
    

posted @ 2024-01-04 16:40  笨功夫才是真功夫  阅读(45)  评论()    收藏  举报