Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the rc.local file in Linux is missing?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what to do if the rc.local file in Linux is lost". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what to do if the rc.local file in Linux is lost".

Solution:

1. Set rc-local.service

Sudo vim / etc/systemd/system/rc-local.service [Unit] Description=/etc/rc.local Compatibility 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

2. Activate rc-local.service

Sudo systemctl enable rc-local.service

3. Add startup service

Manually create or copy an existing / etc/rc.local and grant execution permission

#! / 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.# below this is the command to boot / home/selfcs/anaconda3/bin/Python / home/selfcs/t.py > / home/selfcs/auto.log exit boot Give script execution permission sudo chmod + x / etc/rc.local Thank you for your reading The above is the content of "what to do if the rc.local file in Linux is lost?" after the study of this article, I believe you have a deeper understanding of how to do the missing rc.local file in Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report