I have made the following changes intended for : CE:MW:Shared / mapplauncherd
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/8205 Thank You, Pekka Lundstrom [This message was auto-generated] --- Request # 8205: Messages from BOSS: State: review at 2013-02-27T08:34:27 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:plundstr:branches:CE:MW:Shared / mapplauncherd -> CE:MW:Shared / mapplauncherd changes files: -------------- --- mapplauncherd.changes +++ mapplauncherd.changes @@ -0,0 +1,6 @@ +* Wed Feb 27 2013 Pekka Lundstrom <[email protected]> - 4.0.1 +- Added notification to systemd when initialization is done. + Uses new command line parameter --systemd Fixes NEMO#637 + [Robin Burchell] +- Fix NEMO#598: invoker segfaults when run without --type + old: ---- mapplauncherd-4.0.0.tar.bz2 new: ---- mapplauncherd-4.0.1.tar.bz2 spec files: ----------- --- mapplauncherd.spec +++ mapplauncherd.spec @@ -9,7 +9,7 @@ # << macros Summary: Application launcher for fast startup -Version: 4.0.0 +Version: 4.0.1 Release: 1 Group: System/Daemons License: LGPLv2+ @@ -25,6 +25,7 @@ BuildRequires: pkgconfig(xextproto) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(systemd) BuildRequires: cmake BuildRequires: python BuildRequires: desktop-file-utils @@ -70,7 +71,7 @@ %prep -%setup -q -n %{name} +%setup -q -n %{name}-%{version} # >> setup # << setup other changes: -------------- ++++++ mapplauncherd-4.0.0.tar.bz2 -> mapplauncherd-4.0.1.tar.bz2 --- src/invoker/invoker.c +++ src/invoker/invoker.c @@ -791,12 +791,18 @@ return EXIT_STATUS_APPLICATION_NOT_FOUND; } + if (!app_type) + { + report(report_error, "Application type must be specified with --type.\n"); + usage(1); + } + // Translate 'qt' and 'm' types to 'q' for compatibility if (!strcmp(app_type, "qt") || !strcmp(app_type, "m")) app_type = "q"; // Check if application type is unknown. Only accept one character types. - if (!app_type || !app_type[0] || app_type[1]) + if (!app_type[0] || app_type[1]) { report(report_error, "Application's type is unknown.\n"); usage(1); --- src/launcherlib/CMakeLists.txt +++ src/launcherlib/CMakeLists.txt @@ -19,7 +19,7 @@ # Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore, # but dlopen():ed and listed in src/launcher/preload.h instead. -link_libraries(${LIBDL} ${X11_LIBRARIES}) +link_libraries(${LIBDL} ${X11_LIBRARIES} "-L/lib -lsystemd-daemon") # Set executable add_library(applauncherd MODULE ${SRC} ${MOC_SRC}) --- src/launcherlib/daemon.cpp +++ src/launcherlib/daemon.cpp @@ -41,6 +41,7 @@ #include <fstream> #include <sstream> #include <stdlib.h> +#include <systemd/sd-daemon.h> #include "coverage.h" @@ -60,7 +61,8 @@ m_bootMode(false), m_socketManager(new SocketManager), m_singleInstance(new SingleInstance), - m_reExec(false) + m_reExec(false), + m_notifySystemd(false) { if (!Daemon::m_instance) { @@ -195,6 +197,12 @@ forkBoosters(); } + // Notify systemd that init is done + if (m_notifySystemd) { + Logger::logDebug("Daemon: initialization done. Notify systemd\n"); + sd_notify(0, "READY=1"); + } + // Main loop while (true) { @@ -721,6 +729,10 @@ { m_reExec = true; } + else if ((*i) == "--systemd") + { + m_notifySystemd = true; + } else { if ((*i).find_first_not_of(' ') != string::npos) @@ -743,6 +755,7 @@ " Boot mode can be activated also by sending SIGUSR2\n" " to the launcher.\n" " -d, --daemon Run as %s a daemon.\n" + " --systemd Notify systemd when initialization is done\n" " --debug Enable debug messages and log everything also to stdout.\n" " -h, --help Print this help.\n\n", PROG_NAME_LAUNCHER, PROG_NAME_LAUNCHER, PROG_NAME_LAUNCHER); --- src/launcherlib/daemon.h +++ src/launcherlib/daemon.h @@ -240,6 +240,9 @@ //! True if re-execing bool m_reExec; + //! True if systemd needs to be notified + bool m_notifySystemd; + //! Name of the state saving directory and file static const std::string m_stateDir; static const std::string m_stateFile; --- tests/common/unittests/ut_connection/CMakeLists.txt +++ tests/common/unittests/ut_connection/CMakeLists.txt @@ -20,7 +20,7 @@ # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} -ldl) +link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} -ldl "-L/lib -lsystemd-daemon") # Enable Qt (may not be needed, because already defined on higher level) include(${QT_USE_FILE}) --- tests/common/unittests/ut_daemon/CMakeLists.txt +++ tests/common/unittests/ut_daemon/CMakeLists.txt @@ -20,7 +20,7 @@ # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} -ldl) +link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} -ldl "-L/lib -lsystemd-daemon") # Enable Qt (may not be needed, because already defined on higher level) include(${QT_USE_FILE}) --- tests/common/unittests/ut_socketmanager/CMakeLists.txt +++ tests/common/unittests/ut_socketmanager/CMakeLists.txt @@ -17,7 +17,7 @@ # Set include paths include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER}) -link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY}) +link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} "-L/lib -lsystemd-daemon") # Enable Qt (may not be needed, because already defined on higher level) include(${QT_USE_FILE}) ++++++ mapplauncherd.service --- mapplauncherd.service +++ mapplauncherd.service @@ -4,7 +4,8 @@ Requires=dbus.socket xorg.target [Service] -ExecStart=/usr/bin/applauncherd +Type=notify +ExecStart=/usr/bin/applauncherd --systemd [Install] # For compatibility ++++++ mapplauncherd.yaml --- mapplauncherd.yaml +++ mapplauncherd.yaml @@ -1,6 +1,6 @@ Name: mapplauncherd Summary: Application launcher for fast startup -Version: 4.0.0 +Version: 4.0.1 Release: 1 Group: System/Daemons License: LGPLv2+ @@ -20,6 +20,7 @@ - xextproto - xi - xext + - systemd PkgBR: - cmake - python
