anacron jobs run with wrong environment variables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
anacron (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In Ubuntu 13.04 (anacron-
start -q anacron
This means anacron itself and its child processes would inherit environment from init/upstart not from crond. As result all environment variables defined in /etc/environment won't be set (upstart does not use pam_env.so). In my case, this leads to debtags job failed with network unreachable error, because my host is behind a proxy and http_proxy variable is defined in /etc/environment.
The bug does not affect Debian with Init System V, because invoke-rc.d would start rc script directly.
I suppose anacron should be either started directly from /etc/cron.d/anacron or modified so it use pam to properly initialize session for a job.
I administer >100 hosts with 12.04LTS and 14.04LTS and the problem with anacron not respecting proxy settings is very annoying. apt.d/95proxies in /etc/environment and with gsettings as recommended in http:// askubuntu. com/questions/ 150210/ how-do- i-set-systemwid e-proxy- servers- in-xubuntu- lubuntu- or-ubuntu- studio but still anacron reports errors from e.g. update- notifier- common that it cannot update the flashplugin
I have set the proxy in /etc/apt/
/etc/cron. daily/update- notifier- common: update- notifier/ package- data-downloader ", line 234, in process_ download_ requests urlretrieve( files[i] )[0] python2. 7/urllib. py", line 93, in urlretrieve retrieve( url, filename, reporthook, data) python2. 7/urllib. py", line 239, in retrieve python2. 7/urllib. py", line 207, in open python2. 7/urllib. py", line 344, in open_http s(data) python2. 7/httplib. py", line 954, in endheaders _send_output( message_ body) python2. 7/httplib. py", line 814, in _send_output python2. 7/httplib. py", line 776, in send python2. 7/httplib. py", line 757, in connect address) python2. 7/socket. py", line 571, in create_connection installer: downloading http:// archive. canonical. com/pool/ partner/ a/adobe- flashplugin/ adobe-flashplug in_11.2. 202.394. orig.tar. gz
Traceback (most recent call last):
File "/usr/lib/
dest_file = urllib.
File "/usr/lib/
return _urlopener.
File "/usr/lib/
fp = self.open(url, data)
File "/usr/lib/
return getattr(self, name)(url)
File "/usr/lib/
h.endheader
File "/usr/lib/
self.
File "/usr/lib/
self.send(msg)
File "/usr/lib/
self.connect()
File "/usr/lib/
self.timeout, self.source_
File "/usr/lib/
raise err
IOError: [Errno socket error] [Errno 101] Network is unreachable
flashplugin-