1

This question is related to Debian 8.4.

I applied the same updating mechanism to several desktop stations and one unused server. This problem appeared on the server but I suspect it will happen on all those stations.

As solved in this thread, I managed to get the cron job logged, now I waited for an update. Here it comes and so an error information, which is total gibberish to me right now. Anyone here helps me decipher it, please?

Please first see how I set it up here: How do I know if crontab is working fine?

The relevant part of the log starts when it wants to download archives.

Apr  8 00:00:42 vb-srv-debian updates: Need to get 108 MB of archives.
Apr  8 00:00:42 vb-srv-debian updates: After this operation, 20.5 kB of additional disk space will be used.
Apr  8 00:00:42 vb-srv-debian updates: Get:1 http://dl.google.com/linux/chrome/deb/ stable/main google-chrome-stable amd64 49.0.2623.112-1 [48.5 MB]
Apr  8 00:00:42 vb-srv-debian updates: Get:2 http://nightly.odoo.com/9.0/nightly/deb/ ./ odoo 9.0c.20160407 [59.6 MB]
Apr  8 00:00:54 vb-srv-debian updates: Reading changelogs...
Apr  8 00:01:01 vb-srv-debian updates: debconf: unable to initialize frontend: Dialog
Apr  8 00:01:01 vb-srv-debian updates: debconf: (TERM is not set, so the dialog frontend is not usable.)
Apr  8 00:01:01 vb-srv-debian updates: debconf: falling back to frontend: Readline
Apr  8 00:01:01 vb-srv-debian updates: debconf: unable to initialize frontend: Readline
Apr  8 00:01:01 vb-srv-debian updates: debconf: (This frontend requires a controlling tty.)
Apr  8 00:01:01 vb-srv-debian updates: debconf: falling back to frontend: Teletype
Apr  8 00:01:01 vb-srv-debian updates: dpkg-preconfigure: unable to re-open stdin:
Apr  8 00:01:01 vb-srv-debian updates: Fetched 108 MB in 11s (9,111 kB/s)
Apr  8 00:01:01 vb-srv-debian updates: dpkg: warning: 'ldconfig' not found in PATH or not executable
Apr  8 00:01:01 vb-srv-debian updates: dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
Apr  8 00:01:01 vb-srv-debian updates: dpkg: error: 2 expected programs not found in PATH or not executable
Apr  8 00:01:01 vb-srv-debian updates: Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
Apr  8 00:01:01 vb-srv-debian updates: E: Sub-process /usr/bin/dpkg returned an error code (2)

EDIT: I suspect the main, if not only one, problem is related to PATH variable, which I currently don't understand, how it is used.

EDIT2:

While being root the following variables are returned

echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

echo $TERM

xterm
  • What does echo $PATH return? Also echo $TERM. Update the question. Don't put it in a comment. – Faheem Mitha Apr 7 '16 at 22:31
  • The values you get are correct. Did you do this on the same terminal as the one where the errors occurred? – Faheem Mitha Apr 7 '16 at 22:59
  • @FaheemMitha I just tried it and no error. It works as expected when on terminal. (To be specific I connect to the server via SSH.) Every day there is an update of Odoo, so we will be able to test it again tomorrow if you help me solve the issue. – LinuxSecurityFreak Apr 7 '16 at 23:02
  • I'm confused. Did the problem go away by itself? – Faheem Mitha Apr 7 '16 at 23:03
  • @FaheemMitha No, the script does not work when run from crontab. – LinuxSecurityFreak Apr 7 '16 at 23:05
1

cron typically runs things in a fairly minimal environment (man 5 crontab to see what exactly), which probably doesn't have enough in its path for this. If you want to see what is in the path, you can always run printenv > /tmp/cron_env from (presumably at a time in the near future) to see. Generally you can just define an updated PATH in your crontab file; again see man 5 crontab for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.