Kouhei Sutou
kou****@clear*****
Mon Jun 24 12:47:11 JST 2013
> + 1|2|3|4|5|6|7) > + # curl can't connect to host, service status is unknown > + exit 4 > + ;; 接続できないならサービスが動いていない気がするので、3の方がよ さそうな気がします。ホスト名が引けないとかならサービス確認が できないので4でよさそうな気がします。 In <4d4cc0aa1cfa470c7df8a74c2b6b3bef850b214f �� jenkins.clear-code.com> "[Groonga-commit] groonga/groonga �� 4d4cc0a [master] deb: improve compatibility to LSB about status action (exit codes)" on Mon, 24 Jun 2013 12:17:39 +0900, HAYASHI Kentaro <null+groonga �� clear-code.com> wrote: > HAYASHI Kentaro 2013-06-24 12:17:39 +0900 (Mon, 24 Jun 2013) > > New Revision: 4d4cc0aa1cfa470c7df8a74c2b6b3bef850b214f > https://github.com/groonga/groonga/commit/4d4cc0aa1cfa470c7df8a74c2b6b3bef850b214f > > Message: > deb: improve compatibility to LSB about status action (exit codes) > > see 20.2. Init Script Actions > http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html > > Modified files: > packages/debian/groonga-httpd.init > packages/debian/groonga-server-gqtp.init > packages/debian/groonga-server-http.init > > Modified: packages/debian/groonga-httpd.init (+4 -1) > =================================================================== > --- packages/debian/groonga-httpd.init 2013-06-24 11:32:11 +0900 (0ea5178) > +++ packages/debian/groonga-httpd.init 2013-06-24 12:17:39 +0900 (c1858c0) > @@ -174,7 +174,10 @@ case "$1" in > ;; > status) > do_status > - exit $? > + case "$?" in > + 0) ;; # service is OK > + *) exit 3 ;; # program is not running > + esac > ;; > *) > echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2 > > Modified: packages/debian/groonga-server-gqtp.init (+4 -1) > =================================================================== > --- packages/debian/groonga-server-gqtp.init 2013-06-24 11:32:11 +0900 (ef174f1) > +++ packages/debian/groonga-server-gqtp.init 2013-06-24 12:17:39 +0900 (2f2f3b9) > @@ -219,7 +219,10 @@ case "$1" in > ;; > status) > do_status > - exit $? > + case "$?" in > + 0) ;; # service is OK > + *) exit 3 ;; # program is not running > + esac > ;; > *) > echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2 > > Modified: packages/debian/groonga-server-http.init (+13 -1) > =================================================================== > --- packages/debian/groonga-server-http.init 2013-06-24 11:32:11 +0900 (9550766) > +++ packages/debian/groonga-server-http.init 2013-06-24 12:17:39 +0900 (ebf7398) > @@ -225,7 +225,19 @@ case "$1" in > ;; > status) > do_status > - exit $? > + case "$?" in > + 0) > + # service is OK > + ;; > + 1|2|3|4|5|6|7) > + # curl can't connect to host, service status is unknown > + exit 4 > + ;; > + *) > + # treat as program is not running > + exit 3 > + ;; > + esac > ;; > *) > echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2