Bug#908551: apt-listchanges: apt update hangs if no mail system

2018-09-11 Thread Robert Luberda
RJ pisze:

An issue in apt-listchanges is that handling of Ctrl-C does not work,
when /bin/sh points to dash; this is visible here:

> ^CE: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10
> received signal 2.
> E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10

Pressing Ctrl-C causes apt-listchanges to exit with code 10, so the
above command should return 0, but... dash as parent process receives
SIGINT as well, what ends up with returning code 130.
bash works differently and returns 0, but I guess unfortunately dash
behavior's is correct according to POSIX. I will try to fix this inside
apt-listchanges somehow.

Regards,
robert



Processed (with 1 error): Re: Bug#908551: apt-listchanges: apt update hangs if no mail system

2018-09-11 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> RJ writes:
Unknown command or malformed arguments to command.
> reassign 908551 citadel-server  902-4
Bug #908551 [apt-listchanges] apt-listchanges: apt update hangs if no mail 
system
Bug reassigned from package 'apt-listchanges' to 'citadel-server'.
No longer marked as found in versions apt-listchanges/3.10.
Ignoring request to alter fixed versions of bug #908551 to the same values 
previously set
Bug #908551 [citadel-server] apt-listchanges: apt update hangs if no mail system
Marked as found in versions citadel/902-4.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
908551: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908551
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#908551: apt-listchanges: apt update hangs if no mail system

2018-09-11 Thread Robert Luberda
RJ writes:

reassign 908551 citadel-server  902-4
thanks

> 
> Versions of packages apt-listchanges suggests:
> ii  citadel-server [mail-transport-agent]  902-4


> -- Desription of problem:
> When performing a apt update today (Monday, September 10, 2018) there
> was a news bit about the Apache/2 package that required reading and
> confirmation.
> Upon confirmation the apt-listchanges script returned to attempt to send
> mail to the configured user email (which is just 'root' in this case.)

Yes, apt-listchanges tries to execute `/usr/sbin/sendmail -oi -t'
command. It skips sending mails if the command does not exist.

> IF a system either does not have a mail service installed 

You have citadel-server installed, that provides mail service, so it's
not the case.

> or is
> impropery configured, apt-listchanges will hang while attempting to send
> an email before it allows the update process to continue.

IMHO if a mail service is improperly configured than it should fail
instead of hanging... Then apt-listchanges would display warning message
like this (BTW. I've just temporaily installed the latest version of
citadel-server, trying to reproduce the bug, but its sendmail command
just fails, not hangs):

  apt-listchanges: Mail to root: apt-listchanges: changelogs for vox
citmail: can't connect: No such file or directory
apt-listchanges warning: Cannot send mail to root: Command
'['/usr/sbin/sendmail', '-oi', '-t']' returned non-zero exit status 3.

Then apt-listchanges would continue. I agree, that apt-listchanges could
have set some timeout for  the sendmail command, and I can try to add
such timeout in next version.

> 
> ** I was able to work around this by editing the apt-listchanges script
> file by commenting out the offending Mail section as follows:

A simpler solution would be to run `dpkg-reconfigure apt-listchanges'
and give an empty list of e-mail addresses in the question related to
mail addresses.

> As with the other related 'Wishlist' bug reports for apt-listchanges,
> there should be additional prompts added to this file to:
> 
> (1) Ask if the user wants to mail a report (default N). 

This is done during apt-listchanges installation time, providing that
your debconf settings allows the question about e-mail address list to
appear.

> - Also notify
> user that the process may hang if no mail subsystem exists (which I
> believe is now the case starting with stretch) or is improperly
> configured. (Just 'root')

I think that the sendmail command should hang when misconfigured or for
any other reason - that's why I am reassigning the bug report to
citadel-server. (BTW. I am not sure if this is possible in case of
citadel-server, but maybe sendmail command was trying to send e-mails
via network? How long did you wait before deciding that the command hung?).

> 
> (2) See other 3 reports related to MAIL for additional prompt suggestions.

Could you please be more specific? Which other 3 bug reports are related
to this one?

Regards,
robert



Bug#908551: apt-listchanges: apt update hangs if no mail system

2018-09-10 Thread RJ

Subject: apt-listchanges: apt update hangs if no mail system
Package: apt-listchanges
Version: 3.10
Tags: patch
Justification: breaks unrelated software
Severity: critical



-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)

Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-listchanges depends on:
ii  apt    1.4.8
ii  debconf [debconf-2.0]  1.5.61
ii  debianutils    4.8.1.1
ii  python3    3.5.3-1
ii  python3-apt    1.4.0~beta3
ii  ucf    3.0036

apt-listchanges recommends no packages.

Versions of packages apt-listchanges suggests:
ii  citadel-server [mail-transport-agent]  902-4
pn  python3-gi 
pn  www-browser    
pn  x-terminal-emulator    

-- debconf information:
  apt-listchanges/frontend: pager
  apt-listchanges/which: news
  apt-listchanges/confirm: false
  apt-listchanges/email-address: root
  apt-listchanges/save-seen: true


-- Desription of problem:
When performing a apt update today (Monday, September 10, 2018) there 
was a news bit about the Apache/2 package that required reading and 
confirmation.
Upon confirmation the apt-listchanges script returned to attempt to send 
mail to the configured user email (which is just 'root' in this case.)


IF a system either does not have a mail service installed or is 
impropery configured, apt-listchanges will hang while attempting to send 
an email before it allows the update process to continue.


Ctrl-c breaks the hang as expected but also breaks the update process 
leaving the system in a broken state, unable to update itself.


--BEGIN console output --

Get:70 http://ftp.us.debian.org/debian stretch/main amd64 
libapache2-mod-php7.0 amd64 7.0.30-0+deb9u1 [1,225 kB]
Get:71 http://ftp.us.debian.org/debian stretch/main amd64 php7.0-common 
amd64 7.0.30-0+deb9u1 [877 kB]
Get:72 http://ftp.us.debian.org/debian stretch/main amd64 patch amd64 
2.7.5-1+deb9u1 [112 kB]
Get:73 http://ftp.us.debian.org/debian stretch/main amd64 php7.0 all 
7.0.30-0+deb9u1 [53.4 kB]
Get:74 http://ftp.us.debian.org/debian stretch/main amd64 
shared-mime-info amd64 1.8-1+deb9u1 [731 kB]

Fetched 73.6 MB in 22s (3,309 kB/s)
Reading changelogs... Done
apt-listchanges: Mailing root: apt-listchanges: news for GX520



^CE: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 
received signal 2.

E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10

--END console output --


** I was able to work around this by editing the apt-listchanges script 
file by commenting out the offending Mail section as follows:


-- BEGIN snippet --

    if news or changes:
    apt_listchanges.confirm_or_exit(config, frontend)

    hostname = subprocess.getoutput('hostname')

#    if apt_listchanges.can_send_emails(config):
#    if changes:
#    subject = _("apt-listchanges: changelogs for %s") % 
hostname

#    apt_listchanges.mail_changes(config, changes, subject)

#    if news:
#    subject = _("apt-listchanges: news for %s") % hostname
#    apt_listchanges.mail_changes(config, news, subject)

---END snippet --

Running apt update after this change still allows the News flash and 
confirm dialog, and then continues / completes the system updates as normal.


As with the other related 'Wishlist' bug reports for apt-listchanges, 
there should be additional prompts added to this file to:


(1) Ask if the user wants to mail a report (default N). - Also notify 
user that the process may hang if no mail subsystem exists (which I 
believe is now the case starting with stretch) or is improperly 
configured. (Just 'root')


(2) See other 3 reports related to MAIL for additional prompt suggestions.


- Thank you -