摘要: 有时候为了方便管理,我们常常喜欢在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个级别。  阅读全文
posted @ 2013-04-13 10:38 helloyb 阅读(212) 评论(0) 推荐(0)
摘要: 网上看了很多资料大多比较繁琐,而且很多不能再最新的CentOS6上执行成功,最后还是自己写了一份,以供日后备用:1.首先是写 service脚本service脚本需要进入到目录/etc/init.d中,然后touch memcached,最后vim memcached后进行脚本编写,脚本如下:#chkconfig:3456060#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin exportPATH exportLANG=en_US.UTF-8start() { echo-n$& 阅读全文
posted @ 2013-04-13 10:08 helloyb 阅读(233) 评论(0) 推荐(0)