Install agent socket for systemd
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 23 Jul 2019 16:08:16 +0000 (18:08 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 23 Jul 2019 16:08:16 +0000 (18:08 +0200)
Change-Id: I838788b71908a287fe45c59ed51c20a3f8007a70
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
systemd/CMakeLists.txt
systemd/cynara-agent.socket.in [new file with mode: 0644]
systemd/cynara.service
systemd/sockets.target.wants/cynara-agent.socket [new symlink]

index 3fde22f..9ea1f7e 100644 (file)
@@ -21,12 +21,14 @@ set(SYSTEMD_UNIT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/system"
 
 CONFIGURE_FILE(cynara-admin.socket.in       cynara-admin.socket @ONLY)
 CONFIGURE_FILE(cynara-check.socket.in       cynara-check.socket @ONLY)
+CONFIGURE_FILE(cynara-agent.socket.in       cynara-agent.socket @ONLY)
 
 INSTALL(FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/cynara.service
     ${CMAKE_CURRENT_SOURCE_DIR}/cynara.target
     ${CMAKE_CURRENT_BINARY_DIR}/cynara-admin.socket
     ${CMAKE_CURRENT_BINARY_DIR}/cynara-check.socket
+    ${CMAKE_CURRENT_BINARY_DIR}/cynara-agent.socket
     DESTINATION
     ${SYSTEMD_UNIT_DIR}
 )
diff --git a/systemd/cynara-agent.socket.in b/systemd/cynara-agent.socket.in
new file mode 100644 (file)
index 0000000..12dd064
--- /dev/null
@@ -0,0 +1,15 @@
+[Socket]
+FileDescriptorName=agent
+ListenStream=@DEFAULT_SOCKET_DIR@/cynara.agent
+SocketMode=0600
+SmackLabelIPIn=@
+SmackLabelIPOut=@
+
+Service=cynara.service
+
+[Unit]
+Wants=cynara.target
+Before=cynara.target
+
+[Install]
+WantedBy=sockets.target
index 9cacce6..b7bfd5a 100644 (file)
@@ -14,6 +14,7 @@ Restart=always
 
 Sockets=cynara-admin.socket
 Sockets=cynara-check.socket
+Sockets=cynara-agent.socket
 SmackProcessLabel=System
 
 #UMask=0000
diff --git a/systemd/sockets.target.wants/cynara-agent.socket b/systemd/sockets.target.wants/cynara-agent.socket
new file mode 120000 (symlink)
index 0000000..22b37dd
--- /dev/null
@@ -0,0 +1 @@
+../cynara-agent.socket
\ No newline at end of file