delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/07/01:07:04

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: CRON problems
Date: Thu, 06 May 2004 22:05:55 -0700
Lines: 49
Message-ID: <c7f5fk$oih$1@sea.gmane.org>
References: <BADF3C947A1BD54FBA75C70C241B0B9E01459881 AT ex02 DOT co DOT idirect DOT net> <1083885162 DOT 409ac66a5ab06 AT topcat DOT ims DOT uaf DOT edu> <Pine DOT GSO DOT 4 DOT 56 DOT 0405061940270 DOT 7684 AT slinky DOT cs DOT nyu DOT edu> <1083888621 DOT 409ad3eded2a0 AT topcat DOT ims DOT uaf DOT edu> <409AED9A DOT A91CA4A0 AT dessent DOT net>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: h-67-102-25-114.lsanca54.covad.net
User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502)
In-Reply-To: <409AED9A.A91CA4A0@dessent.net>

Brian Dessent wrote:

> Hank Statscewich wrote:
>
>> Great suggestion. In /var/log/cron.log there were 17 lines of:
>> /usr/sbin/cron: can't open or create /var/run/cron.pid: Permission denied
>>
>> So I just changed permission of the file to 777 and cron started up 
>> just fine.
>> I rebooted and lo and behold cron is still running. I'm changing 
>> permission
>> back to something more appropriate now. I am now a fully satisfied 
>> cygwin user.
>> Thansk for such a great port of linux onto windows, Cygwin is the 
>> best of both
>> worlds (at least for now :)
>
>
> Hmm, seems to me like checking ownership and permissions of cron.pid 
> would be something the cron_diagnose.sh should do. What happened was 
> that you ran it initially as your normal user account, and the pid 
> file was created. Then when you tried to start it as a service, it was 
> running as the SYSTEM account which didn't have permissions to 
> overwrite the file. The solution would be to either just remove it and 
> let cron recreate it, or "chown SYSTEM:SYSTEM /var/run/cron.pid". Then 
> you could give it more restrictive permissions than 777, perhaps 640 
> or 600.

You should also check the ownership/permissions of /var/cron* and 
/var/log/cron.log. When I setup cron I normally do:

# Make sure that certain directories and files do not exist! This is to let
# cron create them, which appears to be the only way to get these created
# correctly!
if [ ! -d /var/cron ]; then
  rm -rf /var/cron
  rm -rf /var/run/cron.pid
  rm -rf /var/log/cron.log

  # Install cron service:
  cygrunsrv -I cron -p /usr/sbin/cron -a -D -d "Cygwin cron" -e 
"MAILTO=$USER AT Salira DOT com" -e "CYGWIN=ntsec"
fi

# Start cron service
cygrunsrv -S cron

-- 
3 kinds of people: those who can count & those who can't.


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019