상태, 우분투의 killproc 명령

상태, 우분투의 killproc 명령

init.dCentos 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

start이 명령은 원래 형식의 우분투 14.04에서 잘 작동하지만 다른 두 기능은 status, killproc우분투 배포판에서 정의되지 않습니다.

우분투 머신에서 이러한 명령에 해당하는 것은 무엇입니까?

답변1

내 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

초기화 스크립트 상단 근처에 있나요?

$ 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

답변2

. /lib/lsb/init 함수

이 줄을 추가하면 나에게 도움이 되었습니다. 감사해요:)

stop)
    echo -n "Shutting down noip2."
    . /lib/lsb/init-functions
    killproc -TERM /usr/local/bin/noip2

관련 정보