Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown polkitd properly on SIGTERM #521

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/polkit/polkitsystembusname.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ polkit_system_bus_name_get_creds_sync (PolkitSystemBusName *system_bus
}

g_variant_unref (result);
g_variant_iter_free (iter);

if (out_uid)
*out_uid = uid;
Expand Down
1 change: 1 addition & 0 deletions src/polkitbackend/polkitbackendactionpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ ensure_all_files (PolkitBackendActionPool *pool)
if (error != NULL)
{
g_warning ("Error enumerating files in %s: %s", dir_name, error->message);
g_error_free (error);
}
else
{
Expand Down
12 changes: 8 additions & 4 deletions src/polkitbackend/polkitd.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ on_name_acquired (GDBusConnection *connection,
}

static gboolean
on_sigint (gpointer user_data)
on_sigint_sigterm (gpointer user_data)
{
g_print ("Handling SIGINT\n");
g_print ("Handling %s\n", (const char *) user_data);
g_main_loop_quit (loop);
return TRUE;
}
Expand Down Expand Up @@ -268,8 +268,12 @@ main (int argc,
loop = g_main_loop_new (NULL, FALSE);

sigint_id = g_unix_signal_add (SIGINT,
on_sigint,
NULL);
on_sigint_sigterm,
"SIGINT");

sigint_id = g_unix_signal_add (SIGTERM,
on_sigint_sigterm,
"SIGTERM");

sighup_id = g_unix_signal_add (SIGHUP,
on_sighup,
Expand Down