Ubuntu14.04设置开机启动脚本(转)】的更多相关文章

原文:https://www.magentonotes.com/ubuntu-config-autostart-shell-script.html 方法一:将脚本添加到文件/etc/rc.local /etc/rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该文件需要root权限才能修改.该脚本具体格式如下, 注意,一定要将命令添加在 exit 0之前,比如我用VirtualBox启动Ubuntu虚拟机,虚拟机上配置的 网络连接是桥接模式,但Ubu…
ubuntu-18.04 设置开机启动脚本 参阅下列链接 https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10 ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 1.建立rc-local.service文件 sudo vi /…
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 2.将下列内容复制进rc-local.service文件 [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=…
ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 1.建立rc-local.service文件 $ sudo vi /etc/systemd/system/rc-local.service 2.复制以下内容 [Unit] Description=/etc/rc.local Compatibility ConditionPat…
需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片机开机启动后执行脚本,如果磁盘达到设置的阈值,就进行空间的清理. rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #!/bin/sh -e # # rc…
方法一.编辑rc.loacl脚本  Ubuntu开机之后会执行/etc/rc.local文件中的脚本,所以我们可以直接在/etc/rc.local中添加启动脚本.在 exit 0 前面添加好脚本代码,如: !/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 succe…
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #!/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 o…
参考:https://www.cnblogs.com/defifind/p/9285456.html    http://www.cnblogs.com/airdot/p/9688530.html systemd 默认读取 /etc/systemd/system 下的配置文件,该目录下的文件会链接/lib/systemd/system/下的文件 打开脚本/lib/systemd/system/rc.local.service  添加末尾几行 [Unit] Description=/etc/rc.…
ubuntu-16.10 开始不再使用initd管理系统,改用systemd systemd is now used for user sessions. System sessions had already been provided by systemd in previous Ubuntu releases. 快速看了 systemd 的使用方法,发现改动有点大, 包括用 systemctl 命令来替换了 service 和 chkconfig 的功能. 比如以前启动 mysql 服务用…
方法1.将脚本放入/etc/rc.local文件中. 方法2.添加一个ubuntu的开机启动服务 分为以下几个步骤: 1)新建一个脚本文件 new_services.sh #!/bin/bash # command content exit 0 2)将脚本放置到启动目录下 sudo mv new_services.sh /etc/init.d/ 3)设置权限 sudo chmod 755 new_services.sh 4)将脚本添加到启动脚本 cd /etc/init.d/ sudo upda…
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 Compatibility ConditionPathExists=/etc/rc.…
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #!/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 o…
sudo touch /etc/rc.d/rc.localsudo vim /etc/rc.d/rc.local 在/etc/rc.d/rc.local文件中写入, 然后使用:wq命令 保存并退出. #!/bin/bash # 在这个文件中写入开机启动需要执行的命令 赋予可执行权限: sudo chmod+x /etc/rc.d/rc.local 设置开机启动: sudo systemctl enable rc-local.service 如果出现以下错误提示: [root@dev-zhangh…
启动应用程序可以帮助我们选择开机启动项.但是在Ubuntu14.04通过Dash输入startup 找不到启动应用程序了,可以通过在控制台输入以下内容: gnome-session-properties…
1 查看自己的系统亮度的最大值: cd /sys/class/backlight 笔记本的显卡型号不同->亮度调节文件夹名会不同. 2 我的是intel_backlight cd intel_backlight 3 max_brightness 系统可以调节的最大亮度值. bightness就是你正使用的亮度值了. cat max_brightness cat brightness (不同的显卡型号,最大值会不一样) 4 在开机启动的时候,设置一下brightness的值: cd /etc su…
1.创建python_auto.bat的快捷方式,放入启动项: C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup python_auto.bat编辑内容为运行脚本的语句,例如:python a.py 2.每周定时执行 # 设置本周或任意一周执行程序时间 sched_Timer = datetime.datetime(2019, 5, 6) now = datetime.date…
vi /etc/rc.d/rc.local 在末尾追加 sh脚本 sh脚本要提前赋予执行权限 下面是测试,开机同步北京时间 [root@commonTest bin]# vi /usr/local/bin/data.sh #!bin/bash ntpdate ntp1.aliyun.com [root@commonTest bin]# chmod data.sh [root@commonTest bin]# vim /etc/rc.d/rc.local #!/bin/bash # THIS FI…
1.sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 2.添加:greeter-show-manual-login=true 3.sudo passwd root(设置root用户密码) 4.reboot…
1.比如lampp其他的都类似: 我是这么操作:(屌丝初学者) a.把lampp启动程序放到/etc/bin下面 b.vi /etc/rc.local ,加入lampp start(有了第一步就可以这样写),当然,完整的写法:/opt/lampp/lampp start 2.未完待续.....…
在终端通过以下命令进行设置,Dash已经搜索不到Startup了: gnome-session-properties 或者直接在Dash中搜索:gnome-session…
ubuntu18.04 不再使用initd管理系统,改用systemd. 然而systemd很难用,改变太大,跟之前的完全不同. 使用systemd设置开机启动为了像以前一样,在/etc/rc.local中设置开机启动程序,需要以下几步: 1.实现原理 systemd 默认会读取 /etc/systemd/system 下的配置文件,该目录下的文件会链接 /lib/systemd/system/ 下的文件.一般系统安装完 /lib/systemd/system/ 下会有 rc-local.ser…
Ubuntu16.04开机启动的脚本一直不支持,错误用在将开机启动脚本放到了home/usr/的目录下,应该放到/root才能正常启动.#!/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…
一:设置开机启动[dos命令] 格式: sc create 服务名称 binPath=空格"安装目录/svnserve.exe -r 版本库地址目录 --service" start=auto 案例: sc create svnserver binPath= "d:/Program Files/Subversion/bin/svnserve.exe -r d:/svnserver --service" start=auto 二:打开服务 net start svns…
原文:http://blog.csdn.net/dante_k7/article/details/7213151 在ubuntu10.04之前的版本都是使用chkconfig来进行管理,而在之后的版本就没有了,如果想继续使用chkconfig命令,只好自己apt-get install下了. [plain] view plaincopy   sudo apt-get install chkconfig 在这里我给大家介绍另两个命令来配置ubuntu的启动服务,sysv-rc-conf和updat…
1.新建脚本文件 我这里是为了设置开机自动设置ipv6隧道,所以命名为ipv6tunnel.sh ifconfig sit0 up ifconfig sit0 inet6 tunnel ::66.220.18.42 ifconfig sit1 up ::c:8a7::/ route -A inet6 add ::/ dev sit1 2.给脚本添加执行权限 chmod +x ipv6tunnel.sh 3.添加开机启动 在/etc/rc.d/rc.local中添加刚刚的脚本(注意是全路径的).在…
一.windows下设置开机启动有如下方法 1 注册表启动项目RUN 2 计划任务,在"windows管理">"计划任务管理器"中新建任务,在操作栏指定要运行的程序和程序参数. 3 以服务类型启动 4 关联到正常启动进程中 开机后隐藏 5.在开始菜单的“启动”里面创建exe或者bat文件,或者创建可执行文件的链接. 二.让java文件开机启动 会脚本就什么都会了,写一个.bat文件,将其复制到C:\ProgramData\Microsoft\Windows\S…
原文:windows下架设SVN服务器并设置开机启动 1.安装SVN服务器,到http://subversion.apache.org/packages.html上下载windows版的SVN,并安装,在命令行下运行svn命令,如下所以,则svn服务器安装成功. C:\Documents and Settings\Administrator>svn 使用“svn help”得到用法.  2.创建仓库Repository:运行命令 C:\Documents and Settings\Adminis…
Linux Redis自动启动,Redis开机启动,Linux Redis设置开机启动 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ©Copyright 蕃薯耀 2017年7月21日 http://www.cnblogs.com/fanshuyao/ Linux Redis安装,Linux如何安…
1. 将下列代码保存为文件redis, 置于 /etc/init.d 下面 ########################### # chkconfig: 2345 90 10 redis服务必须在运行级2,3,4,5下被启动或关闭,启动的优先级是90,关闭的优先级是10 # description: Redis is a persistent key-value database PATH=/usr/local/bin REDISPORT=6379 EXEC=/usr/local/bin/r…
Centos 配置开机启动脚本启动 docker 容器 Intro 我们的 Centos 服务器上部署了好多个 docker 容器,因故重启的时候就会导致还得手动去手动重启这些 docker 容器,为什么不写个脚本自动重启呢,于是就有了这篇文章. 批量启动 Docker 容器 之前我们有提到过关于 docker 的一些骚操作 ,可以直接使用 docker start $(docker ps -aq) # 启动所有容器 docker start $(docker ps -aq -f status=…