Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
Description
Systemd stops the process when the service is stopped on an installed version of the server even if 'couchbase-server -k' returns error code. Moreover, it looks like systemd kills the process brutally - which is not good for items that may be in disk write queues at the time the service is stopped.
Can be reproduced by modifying the couchbase-server script the following way:
1) Add 'return 1' in the beginning of function _stop() in /opt/couchbase/bin/couchbase-server
2) Call 'service couchbase-server stop'
After that status shows:
# service couchbase-server status
|
● couchbase-server.service - Couchbase Server
|
Loaded: loaded (/lib/systemd/system/couchbase-server.service; enabled; vendor preset: enabled)
|
Active: failed (Result: exit-code) since Fri 2019-11-22 23:16:40 UTC; 3s ago
|
Docs: http://docs.couchbase.com
|
Process: 22333 ExecStop=/opt/couchbase/bin/couchbase-server -k (code=exited, status=1/FAILURE)
|
Process: 22015 ExecStart=/opt/couchbase/bin/couchbase-server -- -noinput (code=killed, signal=TERM)
|
Main PID: 22015 (code=killed, signal=TERM)
|
|
Nov 22 23:16:29 alpha systemd[1]: Started Couchbase Server.
|
Nov 22 23:16:31 alpha couchbase[22015]: \{error_logger,{{2019,11,22},\{23,16,31}},"global_trace:~n~p",[{loo
|
Nov 22 23:16:40 alpha systemd[1]: Stopping Couchbase Server...
|
Nov 22 23:16:40 alpha systemd[1]: couchbase-server.service: Control process exited, code=exited status=1
|
Nov 22 23:16:40 alpha systemd[1]: Stopped Couchbase Server.
|
Nov 22 23:16:40 alpha systemd[1]: couchbase-server.service: Unit entered failed state.
|
Nov 22 23:16:40 alpha systemd[1]: couchbase-server.service: Failed with result 'exit-code'.
|