Post

rclocal

rclocal

rc.local

20220401

报错解决:the input device is not a TTY

Shell 变量没解析成功及解决方法

before

How to run scripts on start up?

How to run scripts on start up?

rc.local

No /etc/rc.local file on Ubuntu 18.04? Here’s what to do…

The /etc/rc.local file on Ubuntu and Debian systems are used to execute commands at system startup. But there’s no such file in Ubuntu 18.04.

ubuntu-18.04 设置开机启动脚本

ubuntu-18.04 设置开机启动脚本

编辑rc.local服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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

创建文件rc.local

给rc.local加上权限,启用服务

sudo chmod +x /etc/rc.local sudo systemctl enable rc-local

What user runs the commands defined in /etc/rc.local?

What user runs the commands defined in /etc/rc.local?

Yes, all the scripts and programs are directly called by root.

The /etc/rc.local file is called directly by the init process. 复制成功

This post is licensed under CC BY 4.0 by the author.