This is the mail archive of the cygwin@cygwin.com 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]

cron on Win9x works


I've notice some discussion about problems running cron on Win9x. I'm
currently running cron and init on Win95.  Win98 works too.  I'm not running
anything complex with cron yet though.  Unfortunately, I'm stuck in Win9x
mode, but at least I'm being paid for it.

One thing that is required is the addition of "SYSTEM:*:18:544:,S-1-5-18::"
to the /etc/passwd file.
The ",S-1-5-18" part probably isn't required, but I just simply copied the
entry from an XP machine.  I also added "SYSTEM:S-1-5-18:18:" to /etc/group
but I don't think it matters.

-----------from cron.h----------------
#ifdef __CYGWIN__
#define ROOT_UID 18
#define ROOT_USER "SYSTEM"
#else
-------------------------------------

Try adding the SYSTEM user as mentioned above and then run
/usr/sbin/cron -D.  In this case, the window it is running in will remain
open.  If you run it without the -D and then try to exit from the cmd
window, the window will not close until you kill cron.

I am in the process of writing a cygwin /windows gui app (cygruncmd) modeled
around the service_main() of cygrunsrv.  It will fork and exec a cmd (i.e.
cron or init) redirecting stdout output the to a log such as
/var/log/cron.log as cygrunsrvdoes.  I also plan to use it to run init on
Win9x for agetty.  It needs to be a windows gui app so I can monitor system
shutdown and kill the cmd when the system shuts down.  An option to the app
will be to run with the window hidden.  Another option might be to respawn
when the cmd exits.  Which gets me to another option I might try, running
cron from init.  Not sure about this one.

A few additional notes:
1. cron doesn't seem monitor system clock changes as far as I can tell.  So
if the time is adjusted backwards say from 11:00am - 10:00am, when cron
wakes up and adds 60 seconds to its previous time of 11:00 to 11:01, it will
wait an hour before it wakes again.  I guess this could be a problem in the
fall if the change in time is automatic.  If manually changing the time,
restarting cron is the solution as long as the use knows about the problem.

2. On Win9x, crontab cannot touch the time on "/var/cron/tabs", so cron
doesn't notice a change.  You can get around this my runnning the following
commands, but you MUST not remove the tabs directory close to the 0 second
or cron might exit when it wakes up and cannot find tabs.  Maybe crontab
could be enhanced to make sure the directory time is modified on Win9x
systems.  This workaround is fine for me right now.  I plan to insert a call
to a program that waits until 30 seconds after the minute so cron doesnt
fail between the cp and mv.
------------------------------------------
rm -R -f /var/cron/tabs.sav
cp -R /var/cron/tabs /var/cron/tabs.sav
rm -R -f /var/cron/tabs
mv /var/cron/tabs.sav /var/cron/tabs
----------------------------------------

Hope this helps.

Now if only someone would help me figure out why select returns incorrectly
for serial i/o.
Then I wouldnt have to patch agetty to work around it.

http://sources.redhat.com/ml/cygwin/2003-03/msg02097.html

BB




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]