ubuntu高版本如何设置开机启动脚本
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本
可以通过下列简单设置后,可以使rc.local重新发挥作用。
1、建立rc-local.service文件
sudo vi /etc/systemd/system/rc-local.service
2、将下列内容复制进rc-local.service文件
[Unit]
Description=/etc/rc.local CompatibilityConditionPathExists=/etc/rc.local[Service]Type=forkingExecStart=/etc/rc.local startTimeoutSec=0StandardOutput=ttyRemainAfterExit=yesSysVStartPriority=99[Install]WantedBy=multi-user.targetsudo vi /etc/rc.local#!/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.echo "看到这行字,说明添加自启动脚本成功。" > /usr/local/test.logexit 0sudo chmod +x /etc/rc.localsudo systemctl enable rc-localsudo systemctl start rc-local.service
sudo systemctl status rc-local.servicecat /usr/local/test.logubuntu高版本如何设置开机启动脚本的更多相关文章
- Ubuntu 18.04 设置开机启动脚本 rc.local systemd
ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...
- ubuntu-18.04 设置开机启动脚本-亲测有效
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 2.将下列内容复制进rc-local.servi ...
- ubuntu-18.04 设置开机启动脚本
ubuntu-18.04 设置开机启动脚本 参阅下列链接 https://askubuntu.com/questions/886620/how-can-i-execute-command-on-sta ...
- Ubuntu 16.04设置开机启动脚本的方法
需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片 ...
- Ubuntu 14.04设置开机启动脚本的方法
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...
- ubuntu设置开机启动脚本
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...
- Fedora 21 设置开机启动脚本
sudo touch /etc/rc.d/rc.localsudo vim /etc/rc.d/rc.local 在/etc/rc.d/rc.local文件中写入, 然后使用:wq命令 保存并退出. ...
- Ubuntu14.04设置开机启动脚本(转)
原文:https://www.magentonotes.com/ubuntu-config-autostart-shell-script.html 方法一:将脚本添加到文件/etc/rc.local ...
- ubuntu 18.04 - server版 开机启动脚本
ubuntu 18.04 不再使用 inited 管理系统,改用 systemd systemd 默认读取 /etc/systemd/system 下的文件,该目录下的文件会链接/lib/system ...
随机推荐
- ASP.NET AJAX入门系列(11):在多个UpdatePanle中使用Timer控件
本文将使用Timer控件更新两个UpdatePanel控件,Timer控件将放在UpdatePanel控件的外面,并将它配置为UpdatePanel的触发器,翻译自官方文档. 主要内容 在多个Upda ...
- MySQL程序之mysqlshow详解
mysqlshow命令详解 显示MySQL数据库的结构(数据库.表和列) 如果最后一个参数包含shell或SQL通配符(*,?,%,_)将显示通配符匹配的内容. 如果没有给定数据库,则显示所有匹配的数 ...
- C++用 _findfirst 和 _findnext 查找文件
一.这两个函数均在io.h里面. 二.首先了解一下一个文件结构体: struct _finddata_t { unsigned attrib; time_t tim ...
- Excel技巧--使用规划求解
当我们需要求在有限预算下可以购买的商品数量时,我们就可以使用“规划求解”功能.如上图,在1000元的预算目标内,我们能购买左图中的各书籍多少本.而这些数量,就可以使用“规划求解”来获取答案. 1.实际 ...
- export,import 的用法
摘自https://blog.csdn.net/pcaxb/article/details/53670097: 谢谢!
- Flume的Source
source学习网址: http://flume.apache.org/FlumeUserGuide.html 一.Avro 类型的Source 监听Avro 端口来接收外部avro客户端的事件流.和 ...
- jquery中each()的三种遍历用法
1.选择器+遍历 $('div').each(function (i){ i就是索引值 this 表示获取遍历每一个dom对象 }); 2.选择器+遍历 $('div').each(function ...
- 学习笔记之Data Visualization
Data visualization - Wikipedia https://en.wikipedia.org/wiki/Data_visualization Data visualization o ...
- 廖雪峰Java1-3流程控制-9break、continue
break跳出循环 int sum=0; for(int i=1; ;i++) { sum =sum + i; if(i == 100) { break; } } System.out.println ...
- Volley 结合GSON或FastJson用法
自定义GSON类 public class GsonRequest<T> extends Request<T> { private final Gson mGson = new ...