Add systemd socket 69/99669/6
authorZofia Abramowska <z.abramowska@samsung.com>
Tue, 8 Nov 2016 11:19:52 +0000 (12:19 +0100)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Wed, 30 Nov 2016 13:42:16 +0000 (14:42 +0100)
Current design of askuser notification is too complicated.
This is a first change to move server to askuser-notification
services, so agent UI backend can be less complicated.

Change-Id: I9c14b555cbbd2701fc8c7195f4e196cdaf597ca4

packaging/askuser.spec
systemd/CMakeLists.txt
systemd/askuser-notification.service
systemd/askuser-notification.socket [new file with mode: 0644]

index a9e94fb..a729941 100644 (file)
@@ -97,6 +97,8 @@ rm -rf %{buildroot}
 # todo properly use systemd --user
 ln -s /lib/systemd/user/askuser-notification.service \
 /usr/lib/systemd/user/default.target.wants/askuser-notification.service
+ln -s /lib/systemd/user/askuser-notification.socket \
+/usr/lib/systemd/user/sockets.target.wants/askuser-notification.socket
 ln -s /usr/lib/systemd/system/askuser.service \
 /usr/lib/systemd/system/multi-user.target.wants/askuser.service
 
@@ -145,6 +147,7 @@ systemctl restart cynara.service
 %attr(755,root,root) /usr/bin/askuser-notification
 %if %{with_systemd_daemon}
 /usr/lib/systemd/user/askuser-notification.service
+/usr/lib/systemd/user/askuser-notification.socket
 %endif
 /usr/share/locale/en/LC_MESSAGES/askuser.mo
 /usr/share/locale/pl/LC_MESSAGES/askuser.mo
index 3355833..62f8903 100644 (file)
@@ -24,6 +24,7 @@ INSTALL(FILES
 
 INSTALL(FILES
     ${CMAKE_SOURCE_DIR}/systemd/askuser-notification.service
+    ${CMAKE_SOURCE_DIR}/systemd/askuser-notification.socket
     DESTINATION
     lib/systemd/user
 )
index 3253b6c..615b516 100644 (file)
@@ -3,13 +3,10 @@ Description=Ask user notification
 
 [Service]
 ExecStart=/usr/bin/askuser-notification
-
 Type=notify
-
-KillMode=process
+Sockets=askuser-notification.socket
 TimeoutStopSec=10
 TimeoutStartSec=10
-RestartSec=5
 Restart=always
 
 NoNewPrivileges=true
diff --git a/systemd/askuser-notification.socket b/systemd/askuser-notification.socket
new file mode 100644 (file)
index 0000000..0df0696
--- /dev/null
@@ -0,0 +1,8 @@
+[Socket]
+ListenStream=/run/user/%U/askuser-notification.socket
+SocketMode=0770
+
+Service=askuser-notification.service
+
+[Install]
+WantedBy=sockets.target