2

I have a system that I set up with Maverick and the "automatically apply security updates" setting. It is now sending e-mail on a daily basis:

Subject: Anacron job 'cron.daily' on gwen

/etc/cron.daily/apt:
Segmentation fault

If I manually "apt-get update; apt-get dist-upgrade", it runs just fine. Also, if I login and run /etc/cron.daily/apt it also does not give the segfault.

I did some searches on google and most of the results seem to be from 2008 and related to "pam_mount", which is not on this system.

Sean Reifschneider
  • 10,370
  • 3
  • 24
  • 28

2 Answers2

2

I'm betting your problem stems from insufficient environment variables in that apt script. (eg: $PATH or $LD_LIBRARY_PATH) Essentially, there's a difference between running things via cron and running them in an interactive shell. The latter gets your login environment from places like /etc/profile and ~/.bashrc. Try adding a line or two at the start /etc/cron.daily/apt to import those settings, like so:
. /etc/profile

I'll be totally honest, and point out that I'm not too familiar with Ubunto, so those file locations may not be perfect. If you're using a shell other than Bash, your personal login file may be ~/.profile, or ~/.cshrc, or even something completely different. But the concept is the same.

A related question can be found here.


--Christopher Karel

Christopher Karel
  • 6,442
  • 1
  • 26
  • 34
  • Thanks for the ideas. I agree that it seems like it's a safe bet that it's either something in the environment or related to running without a controlling terminal. A couple of notes: This cron job is something provided by Ubuntu and is meant to be running from cron, but I'll take a look at whether sourcing /etc/profile might help. When I login, I don't have any LD_* variables set. Under 10.04 this cron job definitely does work, so it's something with the job or the commands it calls in 10.10. I've put some debugging in place so I can see WHERE it fails tomorrow. Thanks. – Sean Reifschneider Dec 02 '10 at 07:22
  • Turns out that the reason I couldn't reproduce it from the command-line is that the script doesn't run all the components, depending on how recently it was run from cron. – Sean Reifschneider Dec 03 '10 at 13:30
2

This is a known bug in the python-apt library, documented in Ubuntu bug 664514. Upstream has released a bug-fix, but Ubuntu hasn't assigned this to anyone to fix. More information and interim packages which fix this problem until Ubuntu releases a fix.

Sean Reifschneider
  • 10,370
  • 3
  • 24
  • 28