Before running client in off-line mode, attempt to socket-activate the server 69/34469/4
authorRafal Krypa <r.krypa@samsung.com>
Wed, 4 Feb 2015 16:58:14 +0000 (17:58 +0100)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 5 Feb 2015 15:35:06 +0000 (16:35 +0100)
commitd672a29bd604d58f63bc0be98cd927b45834c41f
treef90015c28bb45bc2ef7395ce192f75291c2c375b
parent144fe4bb52798d07efc936f895153d44bc1074ef
Before running client in off-line mode, attempt to socket-activate the server

Security-manager is started by systemd on socket-activation basis. This
means that it won't start unless a client connects to its socket. But
client library attempts to detect off-line mode by checking whether the
service is already running. This leads to erroneous off-line runs when in
fact a message should be sent over socket to activate the service.

This change adds one more step to off-line mode detection. When the service
isn't running, client will send a special NOOP message over socket.
If systemd manages to activate security-manager service, normal on-line
operation is then performed.

Change-Id: I94b1b10af24e3b90d048fe1b96b8d870da785d8b
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
src/client/client-offline.cpp
src/common/file-lock.cpp
src/common/include/file-lock.h
src/common/include/protocols.h
src/server/service/service.cpp