apt cron.daily script doesn't check value-existence

Bug #223502 reported by Sander Smeenk
50
This bug affects 6 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Low
Michael Vogt
Nominated for Intrepid by D
Jaunty
Fix Released
Low
Michael Vogt

Bug Description

Attached is a patch that fixes a daily cron message on systems that have gconftool installed but do not have values for /system/http_proxy/* set.

Result is now:
| Subject: Cron <root@dot> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
|
| /etc/cron.daily/apt:
| No value set for `/system/http_proxy/use_http_proxy'
| No value set for `/system/http_proxy/host'
| No value set for `/system/http_proxy/port'

Redirecting STDERR to /dev/null doesn't seem to break anything, so please consider applying this patch :)

Revision history for this message
Sander Smeenk (ubuntu-freshdot) wrote :
Revision history for this message
Francesco Usseglio (francescousseglio) wrote :

I have the same problem. I have applied your patch manually. Why do you have inserted the ";" at the end of the first two new lines?

Revision history for this message
Sander Smeenk (ubuntu-freshdot) wrote :

I'm Perl afflicted. That's probably why i tend to type ; after each line. It doesn't hurt though, in the shellscript.

Revision history for this message
Ilja Pavkovic (ipavkovic) wrote :

also happens on one of my systems. The applied patch fixes the problem.

Changed in apt:
status: New → Confirmed
Revision history for this message
Egbert van der Wal (eggie) wrote :

Same here. I gave up after numerous attempts to set a (empty) value for these keys but to no avail. Redirecting to stderr fixes.

Revision history for this message
Seth (bugs-sehe) wrote :

+1

I use this workaround myself.

It is standard behaviour on Ubuntu Server/JeOS installs so it needs to be fixed IMHO

D (dj-lp)
Changed in apt:
assignee: nobody → ubuntu-bugs-apt-get
assignee: ubuntu-bugs-apt-get → ubuntu-core-dev
Revision history for this message
Colin Watson (cjwatson) wrote :

Please don't assign bugs to ubuntu-core-dev. It's sufficient to just leave it unassigned.

Changed in apt (Ubuntu):
assignee: ubuntu-core-dev → nobody
Changed in apt (Ubuntu Jaunty):
importance: Undecided → Low
Michael Vogt (mvo)
Changed in apt (Ubuntu Jaunty):
assignee: nobody → mvo
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.7.20.2ubuntu5

---------------
apt (0.7.20.2ubuntu5) jaunty; urgency=low

  [ Colin Watson ]
  * cmdline/acqprogress.cc:
    - Call pkgAcquireStatus::Pulse even if quiet, so that we still get
      dlstatus messages on the status-fd (LP: #290234).

  [ Michael Vogt ]
  * debian/apt.cron.daily:
    - do not clutter cron mail with bogus gconftool messages
      (LP: #223502)
    - merge fix for cache locking from debian (closes: #459344)
    - run update-apt-xapian-index (with ionice) to ensure that
      the index is up-to-date when synaptic is run (LP: #288797)

 -- Michael Vogt <email address hidden> Mon, 30 Mar 2009 13:22:28 +0200

Changed in apt:
status: Fix Committed → Fix Released
Revision history for this message
Carl Nobile (cnobile1) wrote :

As of April 24, 2009 this bug is back in Hardy, most likely a regression issue.

/etc/cron.daily/apt:
No value set for `/system/http_proxy/use_http_proxy'
No value set for `/system/http_proxy/host'
No value set for `/system/http_proxy/port'

Revision history for this message
Nathaniel W. Turner (nturner) wrote :

The bug status makes this look like it's fixed, but it is still broken in Intrepid (and I can't figure out how to indicate that). As Intrepid is still a supported release, this seems like relevant information.

Revision history for this message
Massimiliano Ballerini (mballerini) wrote :

It seems the values for these variables are user based.

Then if you run the command "gconftool --get /system/http_proxy/use_http_proxy" with a user that is not the proper one, you get that error.

In /etc/cron.daily/apt you have:
admin_user=$(getent group admin|cut -d: -f4|cut -d, -f1)
and:
use=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/use_http_proxy)

This mean the script uses the first user in the group admin, that in this case is my login user.

I added the root user in the group admin, look like it's fixed now. Had to check also if variables were set for user root though, they usually are.
Don't know why a cron job (running as root), would sudo quering the conf table of the the first admin user for the info on the proxy. Looks like a workaround or something unclean, even more for a server install.

This procedure is used also in other cron scripts.

Revision history for this message
Imre Gergely (cemc) wrote :

Confirmed this is still present on Hardy.

Revision history for this message
Jesper Thorup (jesper-jtn) wrote :

Confirmed this is still present on Hardy.

Revision history for this message
NicholasMalaya (nicholas-malaya) wrote :

This is present on Lucid (server)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.