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]

Can't start cron daemon in Cygwin 1.5.23 under WinXP SP2


For several years, I've been a satisfied user of Cygwin's cron on
Windows (happy enough that I trust it to do my daily backups, which is
considerable trust).  Cron might not be easy to install and get
working, but it tends to stay working once it's happy, and that keeps
me happy.

Now that I've replaced the hardware, upgraded to WinXP and reinstalled
Cygwin, I'm having trouble getting cron to work again.  I'd appreciate
any advice on what to do to get cron running.  It's entirely possible
I've skipped some important step in the ritual of cron installation,
so I'd also appreciate informed critique of my notes below.

The high-level symptom is the usual one, namely that cron jobs don't
run, even simple ones that echo a string to a file.  The more
fine-grained symptom is that the cron daemon doesn't start:

(1) Starting it via the cron-config script produces this:

    >cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1053:
    >The service did not respond to the start or control request in a timely fashion.

(2) Starting it manually, of course, very sensibly reports the same thing:

    >$ cygrunsrv --stop cron && cygrunsrv --remove cron && cygrunsrv --install cron -p /usr/sbin/cron -a -D && cygrunsrv --start cron
    >cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1053:
    >The service did not respond to the start or control request in a timely fashion.

(3) Attempting to start it via Windows Services
    (Start/Programs/Administrative Tools/Services) chews on it for a
    while and then pops up a dialog reporting the same thing:

    >Could not start the cron service on Local Computer.
    >Error 1053: The service did not respone to the start or control request in a timely fashion.

    After this, the cron daemon is listed with the "Status" column set
    to "Starting", i.e., not yet "Started".  It apparently never
    completes starting, even when left for days.

So that's all admirably consistent, but doesn't tell me how to get the
cron daemon started.  Here's what I did in my attempt to get cron
running, following the instructions as best I understand them:

(a) Make the group & passwd files and change my group to something sensible:

    >$ mkgroup -lc >/etc/group
    >$ mkpasswd -lc >/etc/passwd

    Then edited /etc/passwd to make my princial group something sensible:

    >$ id
    >uid=421382(nm67644) gid=547(Power Users) groups=544(Administrators),547(Power Users),545(Users),10545(mkgroup_l_d)

(b) Install a mail user agent via the ssmtp-config script, which ends
    up linking /usr/sbin/sendmail.exe to ssmtp:

    >$ ls -l /usr/sbin/sendmail.exe
    >lrwxrwxrwx 1 nm67644 Power Users 19 Jan 10 16:16 /usr/sbin/sendmail.exe -> /usr/sbin/ssmtp.exe

    I won't vouch for it actually sending mail useably, but at least
    it's there.

(c) Use the cron-config script to install and start the cron daemon:

    >$ cron-config
    >Do you want to install the cron daemon as a service? (yes/no) yes
    >
    >The service can run either as yourself or under a privileged account.
    >Running as yourself allows better access to network drives,
    >but does not allow to run the crontab of other users.
    >Do you want to the cron daemon to run as yourself? (yes/no) no
    >
    >
    >Do you want the daemon to run with ntsec? (yes/no) yes
    >
    >
    >Do you want to start the cron daemon as a service now? (yes/no) yes
    >cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1053:
    >The service did not respond to the start or control request in a timely fashion.
    >
    >
    >In case of problem, examine the log file for cron,
    >/var/log/cron.log, and the Windows event log
    >for information about the problem cron is having.
    >
    >If you cannot fix the problem, then report it to cygwin@cygwin.com.
    >Please include a copy of your crontab, ('crontab -l')
    >and the output of 'cygcheck -srv > cygcheck.txt'.
    >
    >Please include the generated file 'cygcheck.txt' *as an attachment*,
    >and NOT in the body of the mail message.

    (Actually, I tried both yes and no answers to the NTSEC question,
    with the same result.  Advice on which setting of NTSEC to use
    would also win some loud appreciation from me.)

(d) Then I ran cron_diagnose.sh because, well, I wanted my cron
    diagnosed, and that seemed like the next reasonable thing to do:

    >$ cron_diagnose.sh
    >cron_diagnose.sh 1.10
    >
    >
    >This script did not find any errors in your cron setup.
    >
    >
    >If you are still unable to get cron to work, then try
    >shutting down the cron service, uninstalling it,
    >reinstalling it, and restarting it.
    >
    >The following commands will do that:
    >  $ cygrunsrv --stop cron
    >  $ cygrunsrv --remove cron
    >  $ cygrunsrv --install cron -p /usr/sbin/cron -a -D
    >      (You can also add a -u switch)
    >  $ cygrunsrv --start cron
    >
    >Also, examine the log file for cron, /var/log/cron.log, for
    >information that it might give you about the problem cron is
    >having.
    >
    >If none of this fixes the problem, then report your problem
    >to cygwin@cygwin.com.  Please include a copy of your crontab,
    >('crontab -l') and the output of 'cygcheck -srv > cygcheck.txt'.
    >
    >Please include the generated file 'cygcheck.txt' *as an attachment*,
    >and NOT in the body of the mail message.

    So basically it didn't find any obvious bogosity.

(e) At this point, I realized I'd be asking for help and so did
    cygcheck -srv >cygcheck_output.txt.  Interestingly, that printed
    some error output to the terminal:
 
    >/usr/bin/cygrunsrv: Error enumerating services: OpenService:  Win32 error 5:
    >Access is denied.

    ... which looked pretty relevant, so I captured it in place via:

    >$ cygcheck -srv >cygcheck_output.txt 2>&1

    ... and attached the result to this message in the canonical way.
-- 
Steve Rowley <sgr@alum.mit.edu> http://alum.mit.edu/www/sgr/ Skype: sgr000
It is very dark & after 2000.  If you continue, you are likely to be eaten by a bleen.

[ATTACHMENT ~/My Documents/cygcheck_output.txt, text/plain]



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