Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Unable to open env file
PostPosted: Sun Sep 23, 2007 12:17 pm 
Offline
Senior Member
User avatar

Joined: Sat Jul 01, 2006 7:36 am
Posts: 50
Location: Ghent, Belgium
Since a couple of weeks I'm getting a very strange error in my logs:
Quote:
Sep 23 16:02:43 tufus CRON[2444]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:09:04 tufus CRON[3554]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:09:04 tufus CRON[3554]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:12:01 tufus CRON[3599]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:12:02 tufus CRON[3599]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:17:01 tufus CRON[3660]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:17:01 tufus CRON[3662]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:17:01 tufus CRON[3660]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:17:03 tufus CRON[3662]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:26:01 tufus CRON[3775]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:26:02 tufus CRON[3775]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:39:02 tufus CRON[4007]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:39:02 tufus CRON[4007]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:40:01 tufus CRON[4022]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 16:40:04 tufus CRON[4022]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
Sep 23 17:02:05 tufus CRON[4146]: pam_env(cron:setcred): Unable to open env file: /etc/environment: No such file or directory
What can I do to solve the problem? :roll:


Top
   
 Post subject:
PostPosted: Sun Sep 23, 2007 12:21 pm 
Offline
Senior Member
User avatar

Joined: Sat Jul 01, 2006 7:36 am
Posts: 50
Location: Ghent, Belgium
This is my root cron, so the error happens everytime a cron is started?
Quote:
# m h dom mon dow command
12 * * * * perl /var/www/awstats.tufus.info/web/cgi-bin/awstats.pl -update -config=5ib2.be >> /dev/null 2>&1
17 * * * * perl /var/www/awstats.tufus.info/web/cgi-bin/awstats.pl -update -config=tufus.info >> /dev/null 2>&1
40 * * * * perl /var/www/awstats.tufus.info/web/cgi-bin/awstats.pl -update -config=saai.be >> /dev/null 2>&1
26 * * * * perl /var/www/awstats.tufus.info/web/cgi-bin/awstats.pl -update -config=gottasport.com >> /dev/null 2>&1
* 5 * * * /usr/bin/php5-cgi /var/www/saai.be/cron-dagelijks.php >> /dev/null 2>&1
09 00 * * Sun rm /var/www/cache/*/* -d -r


Top
   
 Post subject:
PostPosted: Sun Sep 23, 2007 3:44 pm 
Offline
Junior Member

Joined: Sat May 05, 2007 8:53 pm
Posts: 49
Which distro are you using? Debian?

It sounds to me like cron is looking for /etc/environment, so that it has things like PATH when it runs your cron jobs.

I don't have the file on my debian stable linode, and cron works fine for me. But according to this thread at google groups, debian installers have been creating the file since 2002 or so:

http://tinyurl.com/3y93mo

That thread also says that the problem surfaced after upgrading PAM stuff to the packages in testing. I think it's a recent thing.

On my ubuntu box at home, the /etc/environment file is:

Code:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="en_US.UTF-8"


Here's the ownership and permission info:

Code:
-rw-r--r-- 1 root root 111 2007-04-15 11:15 /etc/environment


Maybe this is something wonky in the default linode debian install.


Top
   
 Post subject:
PostPosted: Sun Sep 23, 2007 5:23 pm 
Offline
Senior Member
User avatar

Joined: Sat Jul 01, 2006 7:36 am
Posts: 50
Location: Ghent, Belgium
Thanks for your reply! Yes, I'm running Debian Unstable (Lenny?).
My installation is from a date later then 2002, so it's very strange the file is missing. I will try to make the file manual. I leave the LANG attribute, I read that that's saved somewhere else now.
I checked all the directory's, and I have them all. Also the X11 and the games directory :?. So now I created a file like this:
Quote:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
I let you know what it does.


Top
   
 Post subject:
PostPosted: Mon Sep 24, 2007 11:31 am 
Offline
Senior Member
User avatar

Joined: Sat Jul 01, 2006 7:36 am
Posts: 50
Location: Ghent, Belgium
Problem solved :P.
I will try to remove the PATH, so with an emty file, but now it's working. Thanks!


Top
   
 Post subject:
PostPosted: Wed Sep 26, 2007 2:12 pm 
Offline
Senior Member

Joined: Fri Feb 13, 2004 11:30 am
Posts: 140
Location: England, UK
tofu wrote:
Thanks for your reply! Yes, I'm running Debian Unstable (Lenny?).


FWIW, Lenny is the current testing branch. The unstable branch is, and will always be known as, Sid.


Top
   
 Post subject:
PostPosted: Wed Sep 26, 2007 2:22 pm 
Offline
Senior Member
User avatar

Joined: Sat Jul 01, 2006 7:36 am
Posts: 50
Location: Ghent, Belgium
Thanks for that information.
I said Lenny because phpSysInfo told me that :wink:. But I see it's also speaking about Sid.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group