PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.63k stars 904 forks source link

Invoking pdns_server in monitor mode with init script halts process on SIGTTIN #1671

Closed thenewwazoo closed 10 years ago

thenewwazoo commented 10 years ago

When calling the pdns daemon using the init script, the pdns_server process is halted on SIGTTIN:

vagrant@btmm-server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty
vagrant@btmm-server:/etc/powerdns$ uname -a
Linux btmm-server 3.13.0-33-generic #58-Ubuntu SMP Tue Jul 29 16:45:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
vagrant@btmm-server:/etc/powerdns$ sudo /etc/init.d/pdns monitor
Aug 15 21:28:28 Reading random entropy from '/dev/urandom'
Aug 15 21:28:28 This is a standalone pdns
Aug 15 21:28:28 UDP server bound to 172.28.128.2:53
Aug 15 21:28:28 TCP server bound to 172.28.128.2:53
Aug 15 21:28:28 PowerDNS Authoritative Server 3.4.0-rc1 (jenkins@autotest.powerdns.com) (C) 2001-2014 PowerDNS.COM BV
Aug 15 21:28:28 Using 64-bits mode. Built on 20140801104936 by root@autotest.powerdns.com, gcc 4.7.2.
Aug 15 21:28:28 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.
Aug 15 21:28:28 Creating backend connection for TCP
Aug 15 21:28:28 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:28:28 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:28:28 About to create 3 backend threads for UDP
% Aug 15 21:28:28 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful

From another terminal...

vagrant@btmm-server:~$ sudo strace -p 3741
Process 3741 attached
--- stopped by SIGTTIN ---

(at this point, the process must be SIGKILL'd)

Invoking pdns_server directly works with no problem:

vagrant@btmm-server:/etc/powerdns$ sudo /usr/sbin/pdns_server --daemon=no --guardian=no --control-console --loglevel=9
Aug 15 21:30:01 Reading random entropy from '/dev/urandom'
Aug 15 21:30:01 This is a standalone pdns
Aug 15 21:30:01 UDP server bound to 172.28.128.2:53
Aug 15 21:30:01 TCP server bound to 172.28.128.2:53
Aug 15 21:30:01 PowerDNS Authoritative Server 3.4.0-rc1 (jenkins@autotest.powerdns.com) (C) 2001-2014 PowerDNS.COM BV
Aug 15 21:30:01 Using 64-bits mode. Built on 20140801104936 by root@autotest.powerdns.com, gcc 4.7.2.
Aug 15 21:30:01 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.
Aug 15 21:30:01 Creating backend connection for TCP
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 About to create 3 backend threads for UDP
% Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 gsqlite3: connection to '/etc/powerdns/powerdns.db' successful
Aug 15 21:30:01 Done launching threads, ready to distribute questions
Habbie commented 10 years ago

confirmed broken in 3.4.0-rc1 on Ubuntu 14.04, confirmed working in 3.3.1. Wondering whether this is related to the process group changes (see #1640)