service XXX does not support chkconfig

简介: 原文地址:http://www.cnblogs.com/niocai/archive/2012/07/12/2587780.html 有时候为了方便管理,我们常常喜欢在Linux中将之安装为服务,然后就可以使用服务来管理。

原文地址:http://www.cnblogs.com/niocai/archive/2012/07/12/2587780.html

有时候为了方便管理,我们常常喜欢在Linux中将之安装为服务,然后就可以使用服务来管理。

但是当我们运行安装服务的命令时候,假设服务名为myservice

#chkconfig --add myservice

常常会出现

service myservice does not support chkconfig
我们一般在脚本开头加入下面两句就好了
#gedit /etc/init.d/myservice

添加下面两句到 #!/bin/bash 之后。

# chkconfig: 2345 10 90 
# description: myservice ....

其中2345是默认启动级别,级别有0-6共7个级别。

  等级0表示:表示关机   

  等级1表示:单用户模式   

  等级2表示:无网络连接的多用户命令行模式   

  等级3表示:有网络连接的多用户命令行模式   

  等级4表示:不可用   

  等级5表示:带图形界面的多用户模式   

  等级6表示:重新启动

10是启动优先级,90是停止优先级,优先级范围是0-100,数字越大,优先级越低。

目录
相关文章
|
20天前
|
Android开发
Android Service Call /dev/xxx SELinux
Android Service Call /dev/xxx SELinux
16 1
|
6月前
|
关系型数据库 MySQL Linux
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
37 0
|
6月前
|
Java
解决:Config service failed to start in 120 seconds! Please check ./service/apollo-service.log...
解决:Config service failed to start in 120 seconds! Please check ./service/apollo-service.log...
63 0
|
6月前
|
Apache Windows
Apache No installed service named “Apache2.4“的解决办法
Apache No installed service named “Apache2.4“的解决办法
104 0
|
关系型数据库 MySQL Linux
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
244 0
|
存储 域名解析 Kubernetes
Service、EmptyDir、HostPath | 学习笔记
快速学习 Service、EmptyDir、HostPath
127 0
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
340 0
openstack报错——MainPID=0 Id=neutron-server.service ActiveState=failed
|
JSON Java 数据格式
如何生成自己的Yaas Service yaas
Sent: Tuesday, May 5, 2015 7:54 PM
101 0
如何生成自己的Yaas Service yaas