Cron jobs stopped working : can't lock cron.pid .. Resouce temporarily unavailable

sam naqvi email_amn@yahoo.com
Tue Jun 9 21:08:00 GMT 2009


--- On Tue, 6/9/09, Pierre A. Humblet <Pierre.Humblet@ieee.org> wrote:

> From: Pierre A. Humblet <Pierre.Humblet@ieee.org>
> Subject: Re: Cron jobs stopped working : can't lock cron.pid .. Resouce temporarily unavailable
> To: "sam naqvi" <email_amn@yahoo.com>, cygwin@cygwin.com
> Date: Tuesday, June 9, 2009, 11:45 AM
> 
> ----- Original Message ----- 
> From: "sam naqvi" <>
> To: <cygwin@cygwin.com>
> Sent: Tuesday, June 09, 2009 11:48 AM
> 
> 
> |i had setup some cron jobs on cygwin last Friday. a few of
> them were test scripts to see if the
> cron is firing smoothly on the right time without errors.
> And there were some actual scripts
> too.
> | It was working fine on Friday, giving output to all the
> test scripts at correct times.
> |
> | however, it did not work for the jobs that it had to run
> over the weekend. in fact, now, it
> does not even run the test scripts.
> |
> | an error that i could locate in var/log/Cygwin\
> cron.log  file is as follows:
> | /usr/sbin/cron: can't lock /var/run/cron.pid, otherpid
> may be 9556: Resource temporarily
> unavailable
> | please see the attachment for details.
> |
> | i have gone through the cygwin mail archives and general
> google search on any similar reported
> problem. this problem looks similar (http://www.cygwin.com/ml/cygwin/2008-05/msg00280.html)
> but
> i could not understand what is causing a lock in my case
> and how to fix it. i am a beginner in
> cygwin crons and could not find the problem or the cause of
> it. can someone please help here?
> 
> ****************
> You are running the cron daemon as SYSTEM on a Windows 2003
> Enterprise Server.
> On such a system the demon cannot change user context
> (setuid), thus the jobs don't run.
> 
> According to the log, you started using SYSTEM on May 12
> but on May 13 you were able to
> successfully run the daemon under a user named EXSAN.
> However on Jun 5 at 20:34:54
> you reverted to using SYSTEM.... All of that is clearly
> visible in the cronbug.txt file you
> sent us.
> 
> The message "can't lock /var/run/cron.pid" probably
> indicates that you are trying to start
> a new cron while one is already running.
> 
> Looks like you are not using cron-config to configure and
> start the daemon.
> 
> Pierre
> 
> 

Thank you for your attention and assistance, Pierce. 

cron was reinstalled as 'Cygwin cron' service later under 'Local System' ownership so that any local user who has the local admin rights should be able to have their jobs executed through it. It was to correct an earlier installation which was user specific (EXSAN, as you pointed out), and which did not allow other users (eg, ogbad) to execute their jobs. 

Even after this installation, it was working fine all that Friday 2009/06/05, when the user ogbad was logged in. this user is a member of Local Admin group. however, after (2009/06/05 13:45:02), none of the scheduled jobs executed, neither of exsan ownership, nor of ogbad ownership. 

i did not use cron-config to install, didn't know about it. 
here is how i installed it again as "Cygwin cron".

---------- 
cygrunsrv --stop "Cron daemon"  &&  cygrunsrv --remove "Cron daemon"
# -- did not work

cygrunsrv --stop cron  &&  cygrunsrv --remove cron
# -- took it quietly

cygrunsrv --stop "Cygwin cron" && cygrunsrv --remove "Cygwin cron"
cygrunsrv -I "Cygwin cron" -p /usr/sbin/cron -a '-D' -e "CYGWIN=ntsec"
cygrunsrv --start "Cygwin cron"
cron_diagnose.sh
#-- asked not to install
#-- it found no problems;
---------- 

1. can anyone see please what is locking the cron.pid from (2009/06/05 13:45:02)?
2. do we have to be logged in in order for cron to work?

thank you
AMN




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list