Thursday, November 8, 2007

Install cygwin cron via cron-config script

The following was the steps I took to install cygwin cron in WinXP SP2. Note that the value of CYGWIN should be exactly "ntsec", you can't enter "netsec tty". Also, the /etc/passwd and /etc/group should be set to readable to everyone.

bash$ pwd
/usr/bin

bash$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ntsec smbntsec] ntsec tty
ERROR: Only "[no]ntsec" "[no]smbntsec" "[no]traverse" allowed.
Enter the value of CYGWIN for the daemon: [ntsec smbntsec] ntsec

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 'your_userid': your_password
Reenter: your_password
Running cron_diagnose ...
The file /etc/passwd is not readable by all.
Please run 'chmod +r /etc/passwd'.

The file /etc/group is not readable by all.
Please run 'chmod +r /etc/group'.

There may be serious issues with your environment.
You should look into them and run this script again.
Do you want to continue anyway? (yes/no) no
bash$
bash$ chmod +r /etc/passwd
bash$ chmod +r /etc/group
bash$
bash$ cron-config
Cron is already installed as a service under account your_domain\your_userid.
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] ntsec

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 'your_userid': your_password
Reenter: your_password
Running cron_diagnose ...
WARNING: You do not currently have a crontab file.

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

No comments: