This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cron - error starting a service


----- Original Message ----- 
From: "David Rekas" 
To: cygwin
Sent: Wednesday, September 20, 2006 3:54 AM
Subject: ***[Possible UCE]*** cron - error starting a service


Hi,

I have installed cron-3.0.1-19 within CYGWIN_NT-5.1 1.5.21(0.156/4/2) on
my Win XP 5.1.2600 machine. Configured it with recommended settings and
attempted to start the service, however the notorious error came up:

cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error
1062:
The service has not been started.

Since have searched for and tried many solutions available on the net,
but the same error persists.

Here is a run down of what I've tried so far (the reinstallation of the
service was performed after each fix was tried). 

If there is anything that I've missed, I would really appreciate your
input.

# Used cron_diagnose.sh 1.8 repeatedly until it no longer found any
problems.
# Edited cron-config: enclosed any relavent lines of code which contain
"${USER}" and "$cron_table" in double quotation marks, as these may
contain spaces.
$ mkpasswd -l > /etc/passwd
$ mkpasswd -d -u "$USER" >> /etc/passwd
$ mkgroup -l > /etc/group
$ mkgroup -d -g "Domain Users" >> /etc/group
$ crontab -e
$ chgrp "SYSTEM" "/var/cron/tabs/$USER"
$ chgrp "SYSTEM" /var/run
$ chgrp "SYSTEM" /usr/sbin/cron
$ chgrp "SYSTEM" /usr/sbin/sendmail
$ chmod 640 "/var/cron/tabs/$USER"
$ chmod +x /bin/cygwin1.dll
$ rm -R /etc/cron.d
$ mkdir /etc/cron.d
$ chmod 777 /etc/cron.d

# Config
$ cron-config   // answer: [service: yes; yourslef: no; ntsec: yes]

# Reinstall
cygrunsrv --stop cron
cygrunsrv --remove cron
cygrunsrv --install cron -p /usr/sbin/cron -a -D
cygrunsrv --start cron

# Added SYSTEM to group 544 via the /etc/group
# Attempted to delete /var/run/cron.pid, however it DID NOT exist
# Attempted to check /var/log/cron.log, , however it DID NOT exist
# Checked windows event log it contains the following message each time
cron was attempting to start:
   The description for Event ID ( 0 ) in Source ( cron ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. You may be able to use the /AUXSOURCE= flag to retrieve this
description; see Help and Support for details. The following information
is part of the event: cron: PID 3532: `cron' service stopped, exit
status: 128.

Attached: crontab.txt and cygcheck.txt

Thanks,

Dave

**********************************************************
1) This is the first report (AFAIK) that a cron service installed with cron-config
  does not start (or stops quickly)

2) One special thing about your installation is the space in the user name.
That doesn't seem to be supported by cron, see database.c:
    /* skipfile names with letters outside the set
   * [A-Za-z0-9_-], like run-parts.
   */
  if (!valid_name(dp->d_name))
   continue;

but that's not an obvious reason for the service not to start (or to stop quickly).

To test the "space in user name" hypothesis, remove the crontab file and/or entries in 
/etc/crontab indicating the presence of such a user to cron.

3) Is there a /var/log/cron.log file after the service stops? Note that that file is removed
by cron-config before starting the daemon for the first time.

4) After you use cron-config to install and launch the daemon, there is no reason to
issue the commands under your  "# Reinstall" section". They undo what cron-config did.
cron-config will normally ask you if you want to start the service. Answer yes.
Also there is no reason to add SYSTEM to group 544 via the /etc/group, Cygwin
takes care of that.

Pierre


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]