From: Zofia Abramowska Date: Tue, 8 Nov 2016 11:19:52 +0000 (+0100) Subject: Add systemd socket X-Git-Tag: accepted/tizen/3.0/common/20161206.125312~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41703f339abc0f13717d74294e89be3f48576a45;p=platform%2Fcore%2Fsecurity%2Faskuser.git Add systemd socket 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 --- diff --git a/packaging/askuser.spec b/packaging/askuser.spec index a9e94fb..a729941 100644 --- a/packaging/askuser.spec +++ b/packaging/askuser.spec @@ -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 diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index 3355833..62f8903 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -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 ) diff --git a/systemd/askuser-notification.service b/systemd/askuser-notification.service index 3253b6c..615b516 100644 --- a/systemd/askuser-notification.service +++ b/systemd/askuser-notification.service @@ -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 index 0000000..0df0696 --- /dev/null +++ b/systemd/askuser-notification.socket @@ -0,0 +1,8 @@ +[Socket] +ListenStream=/run/user/%U/askuser-notification.socket +SocketMode=0770 + +Service=askuser-notification.service + +[Install] +WantedBy=sockets.target