Newer Linux distributions no longer have the rc.local file. Because it has been turned into a service. Solution: 1. Set up 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 #!/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. # The following is the command to be started at startup /home/selfcs/anaconda3/bin/python /home/selfcs/t.py > /home/selfcs/auto.log exit 0 #Give the script execution permission sudo chmod +x /etc/rc.local Summarize The above is the perfect solution to the problem of no rc.local file in Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: MySQL full-text fuzzy search MATCH AGAINST method example
Introduction The Docker community has created man...
Table of contents Effects Documentation first ste...
** Detailed graphic instructions for installing y...
When installing FileZilla Server on the server, t...
1. Modify the firewall configuration file # vi /e...
Passive Check With passive health checks, NGINX a...
In the previous article, I wrote a cross-table up...
The question is referenced from: https://www.zhih...
Refer to the tutorial on setting up FTP server in...
(?i) means do not match case. Replace all uppercas...
1. CSS Miscellaneous Icons There are three ways t...
Two ways to enable proxy React does not have enca...
In fact, it is very simple to encapsulate axios i...
<br /> Note: All texts, except those indicat...
Folding display multi-line text component Fold an...