[Popcon-developers] Bug#670421: popularity-contest: prints "...terminated." under systemd

Timo Juhani Lindfors timo.lindfors at iki.fi
Wed Apr 25 12:52:12 UTC 2012


Package: popularity-contest
Version: 1.53
Severity: normal

When I installed popularity-contest I started getting daily emails
from the cronjob with just

/etc/cron.daily/popularity-contest:
 ...terminated.

as a body. I tried to debug this and noticed that it does not occur if
I use sysvinit, only if I use systemd. (I have not tested upstart). I
set

X-Debbugs-CC: Tollef Fog Heen <tfheen at debian.org>

to the systemd maintainer just in case he has some clues on what
popularity-contest might be doing wrong.

Steps to reproduce:
1) apt-get install systemd
2) boot with "init=/bin/systemd"
3) sudo /etc/cron.daily/popularity-contest

Expected results:
3) /etc/cron.daily/popularity-contest does not print anything

Actual results:
3) /etc/cron.daily/popularity-contest prints " ...terimnated.":

lindi2:~$ sudo /etc/cron.daily/popularity-contest 
 ...terminated.
lindi2:~$ echo $?
0
lindi2:~$

More info:
1) strace under systemd shows that this is just before the setsid
command is executed:

...
1023  close(5)                          = 0
1023  getuid()                          = 0
1023  time([1335357656])                = 1335357656
1023  sendto(3, "<86>Apr 25 15:40:56 su[1023]: pam_unix(su:session): session closed for user nobody", 82, MSG_NOSIGNAL, NULL, 0) = 82
1023  close(6)                          = 0
1023  close(4)                          = 0
1023  munmap(0x7f5060d94000, 2101312)   = 0
1023  munmap(0x7f5060970000, 2109656)   = 0
1023  munmap(0x7f506076d000, 2105504)   = 0
1023  munmap(0x7f5060553000, 2200480)   = 0
1023  munmap(0x7f506031c000, 2318784)   = 0
1023  munmap(0x7f506011a000, 2101280)   = 0
1023  munmap(0x7f505ff18000, 2101296)   = 0
1023  munmap(0x7f505fd0d000, 2141576)   = 0
1023  munmap(0x7f5060b74000, 2226128)   = 0
1023  munmap(0x7f505fb09000, 2112168)   = 0
1023  munmap(0x7f505f906000, 2106112)   = 0
1023  munmap(0x7f505f098000, 2112864)   = 0
1023  munmap(0x7f505ee95000, 2105568)   = 0
1023  --- SIGTERM (Terminated) @ 0 (0) ---
1023  rt_sigreturn(0xf)                 = 0
1023  munmap(0x7f505ec91000, 2109648)   = 0
1023  munmap(0x7f505f6c0000, 2382240)   = 0
1023  rt_sigaction(SIGALRM, {0x7f50626aa170, [ALRM], SA_RESTORER|SA_RESTART, 0x7f5061d1d4f0}, {SIG_DFL, [], SA_RESTORER, 0x7f5061d1d4f0}, 8) = 0
1023  alarm(2)                          = 0
1023  wait4(-1, 0x7ffff9cba87c, 0, NULL) = -1 ECHILD (No child processes)
1023  write(2, " ...terminated.\n", 16) = 16
1023  exit_group(0)                     = ?
1005  <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1023
1005  --- SIGCHLD (Child exited) @ 0 (0) ---
1005  rt_sigreturn(0x11)                = 1023
1005  dup2(11, 1)                       = 1
1005  close(11)                         = 0
1005  open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
1005  fcntl(2, F_DUPFD, 10)             = 11
1005  close(2)                          = 0
1005  fcntl(11, F_SETFD, FD_CLOEXEC)    = 0
1005  dup2(3, 2)                        = 2
1005  close(3)                          = 0
1005  stat("/usr/local/sbin/setsid", 0x7fff40dcdf50) = -1 ENOENT (No such file or directory)
1005  stat("/usr/local/bin/setsid", 0x7fff40dcdf50) = -1 ENOENT (No such file or directory)
1005  stat("/usr/sbin/setsid", 0x7fff40dcdf50) = -1 ENOENT (No such file or directory)
1005  stat("/usr/bin/setsid", {st_mode=S_IFREG|0755, st_size=6240, ...}) = 0
1005  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1668ba19d0) = 1149
1005  wait4(-1,  <unfinished ...>
1149  close(10)                         = 0
1149  execve("/usr/bin/setsid", ["setsid", "/usr/share/popularity-contest/popcon-upload", "-u", "http://popcon.debian.org/cgi-bin/popcon.cgi", "-f", "/var/log/popularity-contest"], [/* 16 vars */]) = 0
1149  brk(0)                            = 0xc77000
...

2) strace under sysvinit shows:

1662  time([1335357485])                = 1335357485
1662  sendto(3, "<86>Apr 25 15:38:05 su[1662]: pam_unix(su:session): session closed for user nobody", 82, MSG_NOSIGNAL, NULL, 0) = 82
1662  close(4)                          = 0
1662  munmap(0x7f17cdffb000, 2101312)   = 0
1662  munmap(0x7f17cdbd7000, 2109656)   = 0
1662  munmap(0x7f17cd9d4000, 2105504)   = 0
1662  munmap(0x7f17cd7ba000, 2200480)   = 0
1662  munmap(0x7f17cd583000, 2318784)   = 0
1662  munmap(0x7f17cd381000, 2101280)   = 0
1662  munmap(0x7f17cd17f000, 2101296)   = 0
1662  munmap(0x7f17ccf74000, 2141576)   = 0
1662  munmap(0x7f17cdddb000, 2226128)   = 0
1662  munmap(0x7f17ccd70000, 2112168)   = 0
1662  munmap(0x7f17ccb6d000, 2106112)   = 0
1662  munmap(0x7f17cc2ff000, 2112864)   = 0
1662  munmap(0x7f17cc0fc000, 2105568)   = 0
1662  munmap(0x7f17cbef8000, 2109648)   = 0
1662  munmap(0x7f17cc927000, 2382240)   = 0
1662  exit_group(0)                     = ?
1644  <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1662
1644  --- SIGCHLD (Child exited) @ 0 (0) ---
1644  rt_sigreturn(0x11)                = 1662
1644  dup2(11, 1)                       = 1
1644  close(11)                         = 0
1644  open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
1644  fcntl(2, F_DUPFD, 10)             = 11
1644  close(2)                          = 0
1644  fcntl(11, F_SETFD, FD_CLOEXEC)    = 0
1644  dup2(3, 2)                        = 2
1644  close(3)                          = 0
1644  stat("/usr/local/sbin/setsid", 0x7fff43ae95c0) = -1 ENOENT (No such file or directory)
1644  stat("/usr/local/bin/setsid", 0x7fff43ae95c0) = -1 ENOENT (No such file or directory)
1644  stat("/usr/sbin/setsid", 0x7fff43ae95c0) = -1 ENOENT (No such file or directory)
1644  stat("/usr/bin/setsid", {st_mode=S_IFREG|0755, st_size=6240, ...}) = 0
1644  clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fe13346a9d0) = 1709
1644  wait4(-1,  <unfinished ...>
1709  close(10)                         = 0
1709  execve("/usr/bin/setsid", ["setsid", "/usr/share/popularity-contest/popcon-upload", "-u", "http://popcon.debian.org/cgi-bin/popcon.cgi", "-f", "/var/log/popularity-contest"], [/* 16 vars */]) = 0

3) I also ran

$ sudo bash -x /etc/cron.daily/popularity-contest 
+ '[' '!' -f /usr/sbin/popularity-contest ']'
+ unset MAILFROM
+ unset MAILTO
+ unset MY_HOSTID
+ unset PARTICIPATE
+ unset SUBMITURLS
+ unset USEHTTP
+ unset MTAOPS
+ . /usr/share/popularity-contest/default.conf
++ PARTICIPATE=no
++ MAILTO=survey at popcon.debian.org
++ SUBMITURLS=http://popcon.debian.org/cgi-bin/popcon.cgi
++ USEHTTP=yes
+ . /etc/popularity-contest.conf
++ MY_HOSTID=<REMOVED>
++ PARTICIPATE=yes
++ USEHTTP=yes
++ DAY=3
+ '[' -z survey at popcon.debian.org ']'
+ '[' yes = no ']'
+ '[' -z yes ']'
+ '[' -n '' ']'
+ POPCON=/var/log/popularity-contest
+ '[' 3 ']'
++ date +%w
+ '[' 3 '!=' 3 ']'
+ cd /var/log
+ umask 022
+ savelog -c 7 popularity-contest
+ run_popcon
+ su -s /bin/sh -c /usr/sbin/popularity-contest nobody
 ...terminated.
+ SUBMITTED=no
+ '[' http://popcon.debian.org/cgi-bin/popcon.cgi ']'
+ '[' yes = yes ']'
+ for URL in '$SUBMITURLS'
+ setsid /usr/share/popularity-contest/popcon-upload -u http://popcon.debian.org/cgi-bin/popcon.cgi -f /var/log/popularity-contest
+ SUBMITTED=yes
+ '[' yes '!=' yes ']'
+ '[' yes '!=' yes ']'





-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages popularity-contest depends on:
ii  debconf [debconf-2.0]  1.5.42
ii  dpkg                   1.16.2

Versions of packages popularity-contest recommends:
ii  cron                                       3.0pl1-121
ii  exim4                                      4.77-1
ii  exim4-daemon-light [mail-transport-agent]  4.77-1+b1

Versions of packages popularity-contest suggests:
pn  anacron  <none>

-- debconf information:
  popularity-contest/submiturls:
* popularity-contest/participate: true





More information about the Popcon-developers mailing list