Setting up cron under Cygwin

From PeformIQ Upgrade
Jump to navigation Jump to search

Notes

Important

Run /usr/bin/cron-config command to coinfigure cron!

$ cron-config
Cron is already installed as a service under account DOMAIN\user.
Do you want to remove or reinstall it? (yes/no) yes
OK. The cron service was removed.

Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ntsec smbntsec] 

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) yes

Please enter the password for user 'user': 
Reenter: 
*******************************************************************
* Warning: User mode mounts detected.  This will likely cause     *
* the service to fail to start.  You must have system mode mounts *
* in order to run services.  Re-run setup and choose 'All Users'  *
* or consult the FAQ for more information.                        *
*******************************************************************
Running cron_diagnose ...
... no problem found.

Do you want to start the cron daemon as a service now? (yes/no) yes
OK. The cron daemon is now running.

In case of problem, examine the log file for cron,
/var/log/cron.log, and the Windows event log (using /usr/bin/cronevents)
for information about the problem cron is having.

Examine also any cron.log file in the HOME directory
(or the file specified in MAILTO) and cron related files in /tmp.

If you cannot fix the problem, then report it to cygwin@cygwin.com.
Please run the script /usr/bin/cronbug and ATTACH its output
(the file cronbug.txt) to your e-mail.

Discussions

$ cygrunsrv --stop cron
cygrunsrv: Error stopping a service: OpenService:  Win32 error 1060:
The specified service does not exist as an installed service.

$ ps -ef
     UID     PID    PPID TTY     STIME COMMAND
hardingp    3200       1   ?  16:14:34 /usr/sbin/sshd
hardingp    2796       1 con  17:04:10 /usr/bin/rxvt
hardingp    2708    2796   1  17:04:10 /usr/bin/sh
hardingp    3156       1 con  17:05:37 /usr/bin/rxvt
hardingp     868    3156   0  17:05:37 /usr/bin/sh
hardingp    1328     868   0  17:36:19 /usr/sbin/cron
hardingp    3372       1 con  17:36:28 /usr/bin/rxvt
hardingp    3040    3372   2  17:36:28 /usr/bin/sh
hardingp    2956     868   0  17:46:30 /usr/bin/ps
$ kill -9 1328
$ cygrunsrv --remove cron
cygrunsrv: Error removing a service: OpenService:  Win32 error 1060:
The specified service does not exist as an installed service.

[1]+  Killed                  /usr/sbin/cron -n  (wd: /tmp)
(wd now: /var/run)
$ 
$ cygrunsrv --install cron -p /usr/sbin/cron -a -D
*******************************************************************
* Warning: User mode mounts detected.  This will likely cause     *
* the service to fail to start.  You must have system mode mounts *
* in order to run services.  Re-run setup and choose 'All Users'  *
* or consult the FAQ for more information.                        *
*******************************************************************
$ cygrunsrv --start cron
cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
The service has not been started.

Other

*******************************************************************
* Warning: User mode mounts detected.  This will likely cause     *
* the service to fail to start.  You must have system mode mounts *
* in order to run services.  Re-run setup and choose 'All Users'  *
* or consult the FAQ for more information.                        *
*******************************************************************

I have remounted the directories and now it starts, but the cronjobs do not
work.
If I run the crondiag I get the above message, how to you select all users
from the setup?


Corinna Vinschen-2 wrote:
> 
> On Feb 27 02:03, linux1974 wrote:
>> 
>> I get the error message above when trying to run cron-config.
>> 
>> If i run mount is see the mount point to be there:
>> 
>> $ mount
>> C:\cygwin\bin on /usr/bin type user (binmode)
>> C:\cygwin\lib on /usr/lib type user (binmode)
>                                  ^^^^
> 
> All your mount points are user mounts.  No other user except you can
> see them.  Remove all mounts with umount and recreate them as system
> mounts with mount.  Hint:  The mount -m command might be helpful.
> 
> 
> Corinna
> 
> -- 
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Project Co-Leader          cygwin AT cygwin DOT com
> Red Hat
> 
> --
> 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/
> 
$ mount -m
mount -f -u -t "E:/cygwin/bin" "/usr/bin"
mount -f -u -t "E:/cygwin/lib" "/usr/lib"
mount -f -u -t "E:/cygwin" "/"
mount -u -t --change-cygdrive-prefix "/cygdrive"
mount -s -t --change-cygdrive-prefix "/cygdrive"