我正在尝试将init.d
脚本从 centos 6.6 服务器迁移到 ubuntu 14.04。Centos机器start, status, stop
命令是,
daemon --pidfile=/path/to/pidfile /path/to/daemon/script
status -p /path/to/pidfile /path/to/daemon/script
killproc -p /path/to/pidfile /path/to/daemon/script
Run Code Online (Sandbox Code Playgroud)
start
命令在 ubuntu 14.04 上以其原始形式运行良好,但其他两个函数status, killproc
在 ubuntu 发行版上没有定义。
这些命令在 ubuntu 机器中的等价物是什么?
在我的 Ubuntu 系统上,killproc
由/lib/lsb/init-functions
.
http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
你有没有尝试过把
. /lib/lsb/init-functions
Run Code Online (Sandbox Code Playgroud)
靠近你的初始化脚本的顶部?
$ dpkg -S /lib/lsb/init-functions
lsb-base: /lib/lsb/init-functions
$ dpkg -S /sbin/status
upstart: /sbin/status
$ apt-cache show lsb-base
Package: lsb-base
Priority: required
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10221 次 |
最近记录: |