X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=4.5 required=5.0 tests=BAYES_05,BOTNET,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Message-id: <0b6b01cadda9$e901a0d0$500010ac@wirelessworld.airvananet.com> From: "Pierre A. Humblet" To: "Tom Schutter" , References: <20100416184243 DOT GX5284 AT proxix DOT com> <20100416192909 DOT GA5284 AT proxix DOT com> Subject: Re: cron error can't switch user context Date: Fri, 16 Apr 2010 17:15:15 -0400 MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com ----- Original Message ----- From: "Tom Schutter" To: cygwin Sent: Friday, April 16, 2010 15:29 |I have attached cronbug.txt as per the cron-config instructions. | | Note that the original cronbug.txt was over 5MB. I edited cronbug.txt and removed 46000 lines of cronevents output. Is there any way of cleaning out old cron entries from the event log? | | On Fri 2010-04-16 13:42, Tom Schutter wrote: | > I have number of machines running Windows2003 and Cygwin 1.7.5. On most cron works. But on one (lemon) it does not. It appears that on lemon cron cannot switch the user context. | > | > Cronevents on lemon shows: | > | > 2010/04/15 17:19:01 [SYSTEM] /usr/sbin/cron: PID 656: (tschutter) CMD (/usr/bin/python /cygdrive/f/production-sync/production-sync.py) | > 2010/04/15 17:19:01 [SYSTEM] /usr/sbin/cron: PID 656: (CRON) error (can't switch user context) | > | > /var/log/cron.log is empty on all machines. | > | > The cron daemon is running as SYSTEM on all machines. | > | > cyglsa is running on all machines. | > Hi, I should perhaps modify cronbug to use "tail" with cronevents, but it's unusual to see a report that cron is broken yet there are 46000 lines in the log! I assume cron used to work, then something happened and it stopped working. Or there is something special about the tschutter account. Can you identify the "something" ? Any difference between the lemon and the others? It's most likly not a cron problem, but something to do with cyglsa. I have never used it, don't have a system like yours to test and there is no such previous report. So not sure what to recommend. Does password-less ssh work for tschutter ? If you can't identify the "something", you could try to strace cron on the lemon and on another machine. Here is the recipe. Stop the cron service. Use a simple crontab that runs every minute, for only one user. Using cygrunsrv, create a new service runing "strace" with argument "cron" under SYSTEM 1) cygrunsrv -I trace_cron -p /usr/bin/strace -a /usr/sbin/cron 2) cygrunsrv -S trace_cron 3) Let this run for no more than 2 minutes, output will be in /var/log/trace_cron.log You may have to use kill -9 to stop the service (kill the cron pid) 4) Send the trace_cron.log file as an attachment. 5) Remove the trace_cron service Restart cron Pierre -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple