From gitlab-mirror at kemper.freedesktop.org Thu Aug 1 06:46:12 2019 From: gitlab-mirror at kemper.freedesktop.org (GitLab Mirror) Date: Thu, 1 Aug 2019 06:46:12 +0000 (UTC) Subject: PolicyKit: Branch 'master' - 2 commits Message-ID: <20190801064612.9FEFC761A7@kemper.freedesktop.org> src/programs/pkttyagent.c | 6 ++++++ 1 file changed, 6 insertions(+) New commits: commit 75c8b8afaa8e1fba0efb63c3c7b66b5b5f713a35 Merge: 8f0ef12 76aae4f Author: Jan Rybar Date: Thu Aug 1 06:46:10 2019 +0000 Merge branch 'pkttyagent-sigttou-if-bg' into 'master' pkttyagent: process stopped by SIGTTOU if run in background job See merge request polkit/polkit!34 commit 76aae4fce586b400f5fe08df31497db19d624609 Author: Jan Rybar Date: Thu Aug 1 06:46:10 2019 +0000 pkttyagent: process stopped by SIGTTOU if run in background job 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);