diff options
author | Jan Rybar <jrybar@redhat.com> | 2019-08-01 06:46:10 +0000 |
---|---|---|
committer | Jan Rybar <jrybar@redhat.com> | 2019-08-01 06:46:10 +0000 |
commit | 76aae4fce586b400f5fe08df31497db19d624609 (patch) | |
tree | da24026b40a65e6d8648c0ff50f6b73eaa147087 /src | |
parent | 8f0ef12901d36d1237a28a9abea509daef873feb (diff) | |
download | polkit-76aae4fce586b400f5fe08df31497db19d624609.tar.gz |
pkttyagent: process stopped by SIGTTOU if run in background job
Diffstat (limited to 'src')
-rw-r--r-- | src/programs/pkttyagent.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c index 3c8d502..13879a2 100644 --- a/src/programs/pkttyagent.c +++ b/src/programs/pkttyagent.c @@ -264,6 +264,12 @@ main (int argc, char *argv[]) memset (&sa, 0, sizeof (sa)); sa.sa_handler = &tty_handler; +/* If tty_handler() resets terminal while pkttyagent is run in background job, + the process gets stopped by SIGTTOU. This impacts systemctl, hence it must + be blocked for a while and then the process gets killed anyway. + */ + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGTTOU); sigaction (SIGTERM, &sa, &savesigterm); sigaction (SIGINT, &sa, &savesigint); sigaction (SIGTSTP, &sa, &savesigtstp); |