TIVI-1933, TIVI-1957: Enable socket activation support. accepted/tizen/20131106.223055 accepted/tizen/20131111.231329 accepted/tizen_ivi_stable/20131119.040308 submit/tizen/20131106.220754 submit/tizen_ivi_stable/20131119.035451
authorOssama Othman <ossama.othman@intel.com>
Sun, 3 Nov 2013 05:06:20 +0000 (22:06 -0700)
committerOssama Othman <ossama.othman@intel.com>
Wed, 6 Nov 2013 22:07:09 +0000 (14:07 -0800)
Change-Id: I9e79031a01a74dac03b0aa18405417f983e91244
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
configure.ac
packaging/settingsd.changes
packaging/settingsd.service
packaging/settingsd.socket
packaging/settingsd.spec
src/daemon.cpp

index 2c7599b..59a97b6 100644 (file)
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA  02110-1301  USA
 ])
 
-AC_INIT([settingsd], [0.1], [ossama.othman@intel.com])
+AC_INIT([settingsd], [0.2], [ossama.othman@intel.com])
 AM_INIT_AUTOMAKE([1.11.1 foreign -Wall -Werror silent-rules])
 LT_INIT([disable-static dlopen])
 
index 37b6d10..4203ac9 100644 (file)
@@ -1,3 +1,27 @@
+* Wed Nov 06 2013 Ossama Othman <ossama.othman@intel.com> accepted/tizen/20131003.220350@f0010ff
+- TIVI-1933, TIVI-1957: Enable socket activation support.
+- [dbus_connection] Improved exception safety.
+- Fixed libwebsocket_context race condition.
+- [connman] Share a single connection to D-Bus system bus.
+- Make git ignore Doxygen generated documentation.
+- Removed obsolete 'todo' comment.
+- [smart_ptr] Don't reinvent the wheel.  Leverage std::unique_ptr<>.
+- Removed unused reverse_lock.hpp header.
+- Changed the event JSON format to be more generic.
+- Refactored connman signal callback to generic D-Bus signal callback.
+- Added D-Bus introspection XML for settingsd connman Agent.
+- Effectively make connman_manager a singleton.
+- Implemented event reporting to settings daemon clients.
+- [smart_ptr] Corrected documentation: s/typename/class/
+- Removed unnecessary include directives.
+- Add new line at end of exception log message.
+- Do not continue with initialization if no plugins are found.
+- [manager] Return immediately on empty request.
+- Added missing return value in assignment operator.
+- Do not return in functions with void return types.
+- Updated autoconf-archive boost and C++11 macros to later version.
+- Enable Doxygen doc generation.
+
 * Thu Oct 03 2013 Ossama Othman <ossama.othman@intel.com> 5c4d6b7
 - TIVI-1924: Initial commit of IVI settings daemon.
 
index 8fffad2..435b68d 100644 (file)
@@ -1,11 +1,7 @@
 [Unit]
 Description=Tizen IVI Settings Daemon
-Requires=connman.service
-After=connman.service,weston.target
+After=connman.service
 
 [Service]
 ExecStart=/usr/bin/settingsd
 Restart=on-failure
-
-[Install]
-WantedBy=weston.target
index 8d07b26..4ad1468 100644 (file)
@@ -4,7 +4,5 @@ Description=Tizen IVI Settings Daemon Activation Socket
 [Socket]
 ListenStream=127.0.0.1:16000
 
-# Only allow connections through the loopback network interface.
-BindToDevice=lo
-
-ReusePort=true
+[Install]
+WantedBy=sockets.target
index c3f0c32..90fb6b2 100644 (file)
@@ -1,6 +1,6 @@
 Name:          settingsd
 Summary:       Tizen IVI Settings Daemon
-Version:       0.1
+Version:       0.2
 Release:       1
 Group:         Application Framework/Settings
 License:       LGPL-2.1
@@ -63,9 +63,10 @@ make %{?_smp_mflags}
 rm %{buildroot}%{pkglibdir}/test_setting.so
 
 mkdir -p %{buildroot}%{_unitdir_user}
-install -d %{buildroot}/%{_unitdir_user}/weston.target.wants
+install -d %{buildroot}/%{_unitdir_user}/sockets.target.wants
 install -m 644 %{SOURCE1} %{buildroot}%{_unitdir_user}/settingsd.service
-ln -sf ../settingsd.service %{buildroot}/%{_unitdir_user}/weston.target.wants/
+install -m 644 %{SOURCE2} %{buildroot}%{_unitdir_user}/settingsd.socket
+ln -sf ../settingsd.socket %{buildroot}/%{_unitdir_user}/sockets.target.wants/
 
 %clean
 
@@ -83,7 +84,8 @@ ln -sf ../settingsd.service %{buildroot}/%{_unitdir_user}/weston.target.wants/
 %{pkglibdir}/*.so
 %config %{_sysconfdir}/%{name}/*
 %{_unitdir_user}/settingsd.service
-%{_unitdir_user}/weston.target.wants/settingsd.service
+%{_unitdir_user}/settingsd.socket
+%{_unitdir_user}/sockets.target.wants/settingsd.socket
 
 %files devel
 %manifest %{name}.manifest
index 17b52d7..b403ca4 100644 (file)
@@ -31,6 +31,7 @@
 #include <settingsd/glib_traits.hpp>
 #include <settingsd/unique_ptr.hpp>
 
+#include <cstdlib>
 #include <glib.h>
 #include <iostream>
 #include <thread>
@@ -56,12 +57,24 @@ main(int argc, char * argv[])
     // The websocket server will run in its own thread.
     std::thread(
       [&config, &manager](){
-        // Tie the lifetime of the websocket_server to this thread,
-        // not the main thread, so that we have no lifetime related
-        // race conditions with respect to the underlying
-        // libwebsocket_context object.
-        settings::websocket_server server(config, manager);
-        server.run();
+        // Exceptions are not propagated to other threads with out
+        // explicit code to do that.  Handle exceptions in this
+        // thread.
+        try {
+          // Tie the lifetime of the websocket_server to this thread,
+          // not the main thread, so that we have no lifetime related
+          // race conditions with respect to the underlying
+          // libwebsocket_context object.
+          settings::websocket_server server(config, manager);
+          server.run();
+        }
+        catch (std::exception & e) {
+          std::cerr << e.what() << '\n';
+
+          // Probably not something from which we can recover.  Just
+          // terminate the daemon.
+          std::exit(EXIT_FAILURE);
+        }
       }).detach();
 
     // Glib related events, including GDbus related signal handlers,