[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with cron port



Hi all!

I've encountered a little problem while porting vixie-cron 3.0 to
MiNT. The daemon opens a lock file (/etc/cron.pid) to make sure
only one daemon is running. It does it this way:

 - open the file for reading and writing
 - lock the file for writing
 - if the lock fails, try to read the file (to get the pid of the 
   other cron process) and exit with an error message
 - else, rewind the file, write the current pid in ascii into the
   file, flush it and leave it open.
   
But apparently the lock is not recognized and so more than one daemon
can be started. I am using gcc 2.5.8, mintlibs 45, minixfs 0.60pl10
and MiNT 1.11h2. 
I once read a comment near the creation of the /etc/utmp-file
in an old mintos-suite, at the beginning of init.c:
It was something like "creat opens a file that never gets a length
greater 0 when writing to it", so it has to be done by unlinking
and re-creating it. Maybe this has something to do with my
problem? Seems to be a problem with the mintlibs.

Thanks for your help.
Stephan

-- 
+------------------------------+-----------------------------+
|      Stephan Haslbeck	       |    Fachschaft Informatik    |
|       Agricolastr. 61	       |   Technische Universitaet   |
|      D-80686 Muenchen	       |      Muenchen, Bayern	     |
+------------------------------+-----------------------------+
|Motto: Es gibt keine Probleme,|
|        nur Loesungen.	       |
+------------------------------+