Skip to content
Snippets Groups Projects
Commit dc52bfff authored by Simon McVittie's avatar Simon McVittie
Browse files

launcher: implement Terminate()


This allows IPC clients to terminate the launcher.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 11c1ecff
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,15 @@
<arg type='u' name='wait_status'/>
</signal>
<!--
Terminate:
Stop listening for Launch and SendSignal requests, terminate
child processes if any, and shut down gracefully.
-->
<method name="Terminate">
</method>
</interface>
</node>
......@@ -418,6 +418,16 @@ handle_send_signal (PvLauncher1 *object,
return TRUE;
}
static gboolean
handle_terminate (PvLauncher1 *object,
GDBusMethodInvocation *invocation)
{
terminate_children (SIGTERM);
pv_launcher1_complete_terminate (object, invocation);
unref_skeleton_in_timeout ();
return TRUE; /* handled */
}
static void
name_owner_changed (GDBusConnection *connection,
const gchar *sender_name,
......@@ -480,6 +490,8 @@ export_launcher (GDBusConnection *connection,
G_CALLBACK (handle_launch), NULL);
g_signal_connect (launcher, "handle-send-signal",
G_CALLBACK (handle_send_signal), NULL);
g_signal_connect (launcher, "handle-terminate",
G_CALLBACK (handle_terminate), NULL);
}
if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (launcher),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment