Merge branch '1.1'

pull/1/head
Pertti Kellomäki 14 years ago
commit 52810c0ae2

8
debian/changelog vendored

@ -1,3 +1,11 @@
applauncherd (1.1.0) unstable; urgency=low
* Fixes: NB#262604 - applauncherd not buildable with eglibc 2.12
* Fixes: NB#248543 - [SSU]:Error seen at 'invoker: error: Can't send signal to application: No such process '
* Fixes: NB#273378 - Boosters should restore original signal handlers modified by applauncherd
-- Juha Lintula <juha.lintula@nokia.com> Tue, 14 Jun 2011 14:55:06 +0300
applauncherd (0.30.6) unstable; urgency=low
* Changes: Added test cases for argument passing to cached [QM]Application.

@ -99,7 +99,7 @@ libraries_nokia = [
#(L, "/usr/lib/libdsme.so.0.2.0", "-ldsme", "libdsme0.2.0", "libdsme0.2.0-dev"),
#(L, "/usr/lib/libtimed.so.0", "-ltimed", "libtimed0", "libtimed-dev"),
#(L, "/usr/lib/libqmsystem2.so.1", "-lqmsystem2", "libqmsystem2", "libqmsystem2-dev"),
(L, "/lib/libnss_files-2.10.1.so", "-lnss_files-2.10.1", "libc6", "libc6"),
(L, "/lib/libnss_files.so.2", "-lnss_files", "libc6", "libc6"),
(L, "/usr/lib/libsensordatatypes.so", "-lsensordatatypes", "sensord", "sensord"),
(L, "/usr/lib/libsensorclient.so", "-lsensorclient", "sensord", "sensord"),
#(L, "/usr/lib/libdsme_dbus_if.so.0.2.0", "-ldsme_dbus_if", "libdsme0.2.0", "libdsme0.2.0-dev"),
@ -120,7 +120,7 @@ libraries_nokia = [
#(L, "/usr/lib/libcontentaction.so.0", "-lcontentaction", "libcontentaction0", "libcontentaction-dev"),
#(L, "/usr/lib/libcrypto.so.0.9.8", "-lcrypto", "libssl0.9.8", "libssl-dev"),
#(L, "/usr/lib/libbb5.so.0", "-lbb5", "libbb5-0", "libbb5-dev"),
(L, "/lib/libresolv-2.10.1.so", "-lresolv-2.10.1", "libc6", "libc6"),
(L, "/lib/libresolv.so.2", "-lresolv", "libc6", "libc6"),
#(L, "/usr/lib/libgio-2.0.so.0", "-lgio-2.0", "libglib2.0-0", "libglib2.0-dev"),
#(L, "/usr/lib/libQtSparql.so.0", "-lQtSparql", "libqtsparql0", "libqtsparql-dev"),
#(L, "/usr/lib/libsqlite3.so.0", "-lsqlite3", "libsqlite3-0", "libsqlite3-dev"),
@ -155,9 +155,9 @@ libraries_nokia = [
(D, "/usr/lib/libEGL_r125.so", "-lEGL_r125", "opengles-sgx-img-common", "opengles-sgx-img-common"),
#(L, "/usr/lib/libXdamage.so.1", "-lXdamage", "libxdamage1", "libxdamage-dev"),
#(L, "/usr/lib/libcontextsubscriber.so.0", "-lcontextsubscriber", "libcontextsubscriber0", "libcontextsubscriber-dev"),
(L, "/lib/libdl-2.10.1.so", "-ldl-2.10.1", "libc6", "libc6"),
(L, "/lib/libdl.so.2", "-ldl", "libc6", "libc6"),
#(L, "/usr/lib/libXext.so.6", "-lXext", "libxext6", "libxext-dev"),
(L, "/lib/libpthread-2.10.1.so", "-lpthread-2.10.1", "libc6", "libc6"),
(L, "/lib/libpthread.so.0", "-lpthread", "libc6", "libc6"),
#(L, "/usr/lib/libXau.so.6", "-lXau", "libxau6", "libxau-dev"),
#(L, "/usr/lib/libgobject-2.0.so.0", "-lgobject-2.0", "libglib2.0-0", "libglib2.0-dev"),
#(L, "/usr/lib/libcdb.so.1", "-lcdb", "libcdb1", "libcdb-dev"),
@ -172,7 +172,7 @@ libraries_nokia = [
#(L, "/usr/lib/libXfixes.so.3", "-lXfixes", "libxfixes3", "libxfixes-dev"),
#(L, "/usr/lib/libz.so.1", "-lz", "zlib1g", "zlib1g-dev"),
#(L, "/usr/lib/libxcb.so.1", "-lxcb", "libxcb1", "libxcb1-dev"),
(L, "/lib/libm-2.10.1.so", "-lm-2.10.1", "libc6", "libc6"),
(L, "/lib/libm.so.6", "-lm", "libc6", "libc6"),
#(L, "/usr/lib/libgmodule-2.0.so.0", "-lgmodule-2.0", "libglib2.0-0", "libglib2.0-dev"),
(D, "/usr/lib/libsrv_um_r125.so", "-lsrv_um_r125", "opengles-sgx-img-common", "opengles-sgx-img-common"),
#(L, "/usr/lib/libpng12.so.0", "-lpng12", "libpng12-0", "libpng12-dev"),
@ -181,7 +181,7 @@ libraries_nokia = [
#(L, "/lib/libglib-2.0.so.0", "-lglib-2.0", "libglib2.0-0", "libglib2.0-dev"),
#(L, "/usr/lib/libXrender.so.1", "-lXrender", "libxrender1", "libxrender-dev"),
#(L, "/usr/lib/libicuuc.so.44", "-licuuc", "libicu44", "libicu-dev"),
(L, "/lib/librt-2.10.1.so", "-lrt-2.10.1", "libc6", "libc6"),
(L, "/lib/librt.so.1", "-lrt", "libc6", "libc6"),
]
# Choose library list based on build environment

@ -89,7 +89,19 @@ static void sig_forwarder(int sig)
{
if (kill(g_invoked_pid, sig) != 0)
{
report(report_error, "Can't send signal to application: %s \n", strerror(errno));
if (sig == SIGTERM && errno == ESRCH)
{
report(report_info,
"Can't send signal SIGTERM to application [%i] "
"because application is already terminated. \n",
g_invoked_pid);
}
else
{
report(report_error,
"Can't send signal %i to application [%i]: %s \n",
sig, g_invoked_pid, strerror(errno));
}
}
// Restore signal handlers

@ -405,12 +405,8 @@ void Daemon::forkBooster(char type, int sleepTime)
if (newPid == 0) /* Child process */
{
// Reset used signal handlers
signal(SIGCHLD, SIG_DFL);
signal(SIGTERM, SIG_DFL);
signal(SIGUSR1, SIG_DFL);
signal(SIGUSR2, SIG_DFL);
signal(SIGPIPE, SIG_DFL);
// Restore used signal handlers
restoreUnixSignalHandlers();
// Will get this signal if applauncherd dies
prctl(PR_SET_PDEATHSIG, SIGHUP);
@ -767,6 +763,33 @@ void Daemon::killBoosters()
// in order to automatically start new boosters.
}
void Daemon::setUnixSignalHandler(int signum, sighandler_t handler)
{
struct sigaction *oldAct = new struct sigaction();
struct sigaction newAct;
newAct.sa_handler = handler;
sigemptyset(&newAct.sa_mask);
newAct.sa_flags |= SA_RESTART;
if (sigaction(signum, &newAct, oldAct) == 0)
{
m_originalSigHandlers[signum] = oldAct;
} else {
throw std::runtime_error("Daemon: Failed to set signal handler");
}
}
void Daemon::restoreUnixSignalHandlers()
{
for (SigHandlerMap::iterator it = m_originalSigHandlers.begin(); it != m_originalSigHandlers.end(); it++ )
{
sigaction(it->first, it->second, NULL);
}
m_originalSigHandlers.clear();
}
Daemon::~Daemon()
{
delete m_socketManager;

@ -97,6 +97,16 @@ public:
*/
int sigPipeFd() const;
/*!
* Set unix signal handler and save its original value.
*/
void setUnixSignalHandler(int signum, sighandler_t handler);
/*!
* Restore unix signal handlers to their saved values.
*/
void restoreUnixSignalHandlers();
private:
//! Disable copy-constructor
@ -221,6 +231,10 @@ private:
//! Single instance plugin handle
SingleInstance * m_singleInstance;
//! Original unix signal handlers are saved here
typedef map<int, struct sigaction*> SigHandlerMap;
SigHandlerMap m_originalSigHandlers;
#ifdef UNIT_TEST
friend class Ut_Daemon;
#endif

@ -93,12 +93,13 @@ DECL_EXPORT int main(int argc, char * argv[])
// Get fd for signal pipe.
g_sigPipeFd = myDaemon.sigPipeFd();
// Install signal handlers
signal(SIGCHLD, sigChldHandler); // reap zombies
signal(SIGTERM, sigTermHandler); // exit launcher
signal(SIGUSR1, sigUsr1Handler); // enter normal mode from boot mode
signal(SIGUSR2, sigUsr2Handler); // enter boot mode (same as --boot-mode)
signal(SIGPIPE, sigPipeHandler); // broken invoker's pipe
// Install signal handlers. The original handlers are saved
// in the daemon instance so that they can be restored in boosters.
myDaemon.setUnixSignalHandler(SIGCHLD, sigChldHandler); // reap zombies
myDaemon.setUnixSignalHandler(SIGTERM, sigTermHandler); // exit launcher
myDaemon.setUnixSignalHandler(SIGUSR1, sigUsr1Handler); // enter normal mode from boot mode
myDaemon.setUnixSignalHandler(SIGUSR2, sigUsr2Handler); // enter boot mode (same as --boot-mode)
myDaemon.setUnixSignalHandler(SIGPIPE, sigPipeHandler); // broken invoker's pipe
// Run the main loop
myDaemon.run();

@ -37,6 +37,12 @@
<case name="applauncherd__test_nonlaunchable_apps" type="Functional" description="Test for booster warning while invoking non launchable apps" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_nonlaunchable_apps</step>
</case>
<case name="applauncherd__test_signal_status_m" type="Functional" description="Test that SigBlk, SigIgn and SigCgt is same for launched and non launched applications" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_m</step>
</case>
<case name="applauncherd__test_signal_status_qml" type="Functional" description="Test that SigBlk, SigIgn and SigCgt is same for launched and non launched applications" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_qml</step>
</case>
<!--case name="applauncherd__test_application_specific_theming" type="Functional" description="Application specific theming tests" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_theming.rb name test_application_specific_theming</step>
</case>

@ -51,6 +51,8 @@ LAUNCHABLE_APPS = ['/usr/bin/fala_ft_hello','/usr/bin/fala_ft_hello1', '/usr/bin
LAUNCHABLE_APPS_QML = ['/usr/bin/fala_qml_helloworld','/usr/bin/fala_qml_helloworld1', '/usr/bin/fala_qml_helloworld2']
PREFERED_APP = '/usr/bin/fala_ft_hello'
PREFERED_APP_QML = '/usr/bin/fala_qml_helloworld'
GET_COORDINATE_SCRIPT = '/usr/share/applauncherd-testscripts/get-coordinates.rb'
PIXELCHANHED_BINARY = '/usr/bin/fala_pixelchanged'
using_scratchbox = False
@ -1268,6 +1270,57 @@ class launcher_tests (unittest.TestCase):
pos = op.split("\n")[0].find("Booster: Loading symbol 'main' failed:")
self.assert_(pos != -1, "The booster did not give warning")
def test_signal_status_m(self):
self._test_signal_status("fala_wl", "fala_wol")
def test_signal_status_qml(self):
self._test_signal_status("fala_qml_wl", "fala_qml_wol")
def _test_signal_status(self, app_wl, app_wol):
"""
Test that values of SigBlk, SigIgn and SigCgt in /proc/pid/status
is same for both boosted and non boosted applications
"""
#Get status for non boosted apps
os.system("initctl restart xsession/mthome")
time.sleep(5)
st, op = commands.getstatusoutput("%s -a %s" %(GET_COORDINATE_SCRIPT, app_wol))
time.sleep(2)
pos = op.split("\n")[-1]
os.system("%s -c %s -q" %(PIXELCHANHED_BINARY, pos))
time.sleep(2)
pid = get_pid(app_wol)
st, SigBlk_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigBlk" %pid)
st, SigIgn_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigIgn" %pid)
st, SigCgt_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigCgt" %pid)
kill_process(app_wol)
time.sleep(2)
#Get status for booster application
os.system("initctl restart xsession/mthome")
time.sleep(5)
st, op = commands.getstatusoutput("%s -a %s" %(GET_COORDINATE_SCRIPT, app_wl))
time.sleep(2)
pos = op.split("\n")[-1]
os.system("%s -c %s -q" %(PIXELCHANHED_BINARY, pos))
time.sleep(2)
pid = get_pid(app_wl)
st, SigBlk_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigBlk" %pid)
st, SigIgn_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigIgn" %pid)
st, SigCgt_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigCgt" %pid)
kill_process(app_wl)
time.sleep(2)
self.assert_(SigBlk_wol == SigBlk_wl, "The SigBlk is not same for both apps")
self.assert_(SigIgn_wol == SigIgn_wl, "The SigIgn is not same for both apps")
self.assert_(SigCgt_wol == SigCgt_wl, "The SigCgt is not same for both apps")
# main
if __name__ == '__main__':
# When run with testrunner, for some reason the PATH doesn't include

Loading…
Cancel
Save