https://ubuntuforums.org/showthread.php?t=2327011

1、方法一,编辑rc.loacl脚本

Ubuntu开机之后会执行/etc/rc.local文件中的脚本,
所以我们可以直接在/etc/rc.local中添加启动脚本。
当然要添加到语句:exit 0 前面才行。
如:

复制代码

代码如下:

sudo vi /etc/rc.local

然后在 exit 0 前面添加好脚本代码。

2、方法二,添加一个Ubuntu的开机启动服务。

如果要添加为开机启动执行的脚本文件,
可先将脚本复制或者软连接到/etc/init.d/目录下,
然后用:update-rc.d xxx defaults NN命令(NN为启动顺序),
将脚本添加到初始化执行的队列中去。
注意如果脚本需要用到网络,则NN需设置一个比较大的数字,如99。
1) 将你的启动脚本复制到 /etc/init.d目录下
 以下假设你的脚本文件名为 test。
2) 设置脚本文件的权限

复制代码

代码如下:

$ sudo chmod 755 /etc/init.d/test

3) 执行如下命令将脚本放到启动脚本中去:

复制代码

代码如下:

$ cd /etc/init.d
$ sudo update-rc.d test defaults 95

注:其中数字95是脚本启动的顺序号,按照自己的需要相应修改即可。在你有多个启动脚本,而它们之间又有先后启动的依赖关系时你就知道这个数字的具体作用了。该命令的输出信息参考如下:

复制代码

代码如下:

update-rc.d: warning: /etc/init.d/test missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/test ...
/etc/rc0.d/K95test -> ../init.d/test
/etc/rc1.d/K95test -> ../init.d/test
/etc/rc6.d/K95test -> ../init.d/test
/etc/rc2.d/S95test -> ../init.d/test
/etc/rc3.d/S95test -> ../init.d/test
/etc/rc4.d/S95test -> ../init.d/test
/etc/rc5.d/S95test -> ../init.d/test

卸载启动脚本的方法:

复制代码

代码如下:

$ cd /etc/init.d
$ sudo update-rc.d -f test remove

命令输出的信息参考如下:

复制代码

代码如下:

Removing any system startup links for /etc/init.d/test ...
/etc/rc0.d/K95test
/etc/rc1.d/K95test
/etc/rc2.d/S95test
/etc/rc3.d/S95test
/etc/rc4.d/S95test
/etc/rc5.d/S95test
/etc/rc6.d/K95test

-------------------------------------------------------------------------------------------------

Re: insserv: warning: script 'lampp' missing LSB tags and overrides

 Originally Posted by sreez 
Iam using ubuntu 16.04 server while adding lampp service to automatic startup on the boot sudo update-rc.d lampp defaults. Its shows the error insserv: warning: script 'lampp' missing LSB tags and overrides insserv: There is a loop between service monit and lampp if stopped insserv: loop involving service lampp at depth 2 insserv: loop involving service monit at depth 1 insserv: Stopping lampp depends on monit and therefore on system facility `$all' which can not be true! insserv: exiting now without changing boot order! update-rc.d: error: insserv rejected the script header plz help to fix it. thanks in advance.

have same issue and fix this with edit lampp script

Code:
#!/bin/bash
### BEGIN INIT INFO
# Provides: lampp
# Required-Start: $local_fs $syslog $remote_fs dbus
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start lampp
### END INIT INFO
/opt/lampp/lampp start

insserv: warning: script 'lampp' missing LSB tags and overrides的更多相关文章

  1. insserv: warning: script 'busybox-httpd' missing LSB tags and overrides

    /********************************************************************************* * insserv: warnin ...

  2. Ubuntu做Tomcat服务:insserv: warning: script 'tomcat' missing LSB tags and overrides

    https://blog.csdn.net/hanchao5272/article/details/79819460 转载自:https://blog.bbzhh.com/index.php/arch ...

  3. 解决chkconfig设置开机启动时出现missing LSB的错误

    0x00 主要原因是脚本不符合LSB tags规范,在#!/bin/bash下面添加如下代码即可 以tomcat为例 ### BEGIN INIT INFO # Provides: bbzhh.com ...

  4. Obj-C, library with ARC code and warning - Method possibly missing a [super dealloc] call?

    1 down vote favorite I'm adding the MKStoreKit to my app and I'm getting a warning, Method possibly ...

  5. warning:Pointer is missing a nullability type specifier (__nonnull or __nullable)

    当我们定义某个属性的时候  如果当前使用的编译器版本比较高(6.3+)的话经常会遇到这样一个警告:warning:Pointer is missing a nullability type speci ...

  6. 解决ubuntu的chkconfig[/sbin/insserv 无法找到路径问题]

    http://www.cnblogs.com/lost-1987/archive/2012/10/17/2727285.html 今天在虚拟机里做DRBD实验,使用chkconfig管理服务的时候,出 ...

  7. redis-在乌班图下设置自动启动

    一.修改redis.conf 1.打开后台运行选项,默认情况下,Redis不在后台运行: daemonize yes 2.配置log文件地址,默认使用标准输入,即打印在命令行终端 的窗口上 logfi ...

  8. supervisor 从安装到使用

    (转)https://www.jianshu.com/p/3658c963d28b 一.安装 源码安装 先下载最新的supervisor安装包:https://pypi.python.org/pypi ...

  9. ubuntu16 下安装redis 以及设置其为开机启动

    1.下载redis安装包 sudo wget http://download.redis.io/releases/redis-3.2.6.tar.gz 2.解压 tar -zxvf  redis-3. ...

随机推荐

  1. 微信小程序登录对接Django后端实现JWT方式验证登录

    先上效果图 点击授权按钮后可以显示部分资料和头像,点击修改资料可以修改部分资料. 流程 1.使用微信小程序登录和获取用户信息Api接口 2.把Api获取的用户资料和code发送给django后端 3. ...

  2. Python函数高级

    函数对象 在面向对象编程中 一切皆对象 函数在python中是第一类对象 函数可以这么用 可以被引用 def func(): print('hello world !') ​ f=func f() 可 ...

  3. LCD驱动分析(三)时序分析

    参考:S3C2440 LCD驱动(FrameBuffer)实例开发<一>   S3C2440 LCD驱动(FrameBuffer)实例开发<二>

  4. 牛客网暑期ACM多校训练营(第一场)J Different Integers(树状数组, 离线)

    题意: 给定n个数字, 然后给出m个区间, 求区间外其他数字的种类有多少. 分析: 将区间以r为基准升序排序, 每次处理pre~r的数字第一次出现的位置. #include<bits/stdc+ ...

  5. 关于set和multiset的一些用法

    set的一些用法 set的特性 set的特性是,所有元素都会根据元素的键值自动排序,set不允许两个元素有相同的键值. set的一些常用操作函数 insert() insert(key_value); ...

  6. vue.js 利用SocketCluster实现动态添加数据及排序

    直接上代码 html: <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...

  7. c#笔记2019-01-06

    using System; using System.Collections.Generic; using System.Linq; using System.Text; /*2019-01-06C# ...

  8. PHP 获取文件名和扩展名的方法

    dirname(path) path: 代表你的文件路径,必须为绝对路径,可以使用__FILE__, 表示列出当前文件的绝对路径,包含文件名 函数会返回当前文件的上一级路径,也就是除了文件名称的路径 ...

  9. A Survey of Model Compression and Acceleration for Deep Neural Network时s

    A Survey of Model Compression and Acceleration for Deep Neural Network时s 本文全面概述了深度神经网络的压缩方法,主要可分为参数修 ...

  10. SPOJ-New Distinct Substrings,注意会爆int

    SUBST1 - New Distinct Substrings 和上一题题意一样,只是数据范围有所改动,50000. 思路还是和上一题一样,所有字串数(len+1)*len/2.注意这里可能爆int ...