Ugh, top-posting.  Reformatted again...

On Fri, 7 Oct 2005, Orfeo Da Via wrote:

> On Fri, 7 Oct 2005, Igor Pechtchanski wrote:
>
> > Ugh, top-posting.  Reformatted...
> >
> > On Fri, 7 Oct 2005, Orfeo Da Via wrote:
> >
> > > Earlier I wrote:
> > > > I'll quote your crontab inline to better comment on it:
> > > >
> > > > # DO NOT EDIT THIS FILE - edit the master and reinstall.
> > > > # (/tmp/crontab.580 installed on Fri Oct  7 14:09:56 2005)
> > > > # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp 
> > > > $)
> > > > 10 14 * * * /bin/date >> /usr/tmp/date.out;
> > > >
> > > > First off, I'm not sure how cron will react to the semicolon at the end.
> > > > Secondly, you need to redirect stderr as well as stdout, or deal with 
> > > > cron
> > > > trying to mail you the output.
> > > >
> > > > Try
> > > >
> > > > 10 14 * * * /bin/date >> /usr/tmp/date.out 2>&1
> > > >
> > > > and see if that works for you (it should).  If not, take a look at
> > > > /var/log/cron.log and the Windows Event Log for any relevant messages 
> > > > from
> > > > cron.
> > >
> > > Hi Igor,
> > > thanks for your quicky reply!
> > >
> > > I tryed in this way
> > >
> > > $ crontab -l
> > >  10 14 * * * /bin/date >> /usr/tmp/date.out 2>&1
> > >
> > > but doesn't work!!
> >
> > What is your indication that it doesn't work?  Do you have anything in
> > /usr/tmp/date.out?  What are the permissions on that file?
> >
> > > In attch. files is generated from:
> > >
> > > $ cat /var/log/cron.log > cron.log.txt
> >
> > What are the permissions on /var/log/cron.log?
> >
> > > $ ps -elf > ps-elf.txt
> >
> > This shows that cygrunsrv is running as user "micekiller".  It should be
> > running as SYSTEM.  What exact command did you use to install your cron
> > service?
> >
> > > I've also changed the permission of my cron.pid
> > >
> > > $ chown a+x /var/run/cron.pid
> >
> > Did you mean "chmod a+rw"?  The command below seems to indicate that...
> >
> > > $ ls -l /var/run/cron.pid
> > >
> > > In event.log the Windows Event Log output.. IMHO is generated from
> > >
> > > $ crontab -l
> > >
> > > Thanks
> > >   Orfeo
> >
> > Your eventlog.txt shows only one event:
> >
> > crontab : PID 1628 : (micekiller) LIST (micekiller).
> >
> > This is indeed from "crontab -l".  Are you sure there are no more
> > cron-generated events there?
> >     Igor
>
> OK I start from the begin:
>
> $ whoami
>   micekiller
> $ cd /etc/
> $ mkpasswd.exe -l -g > passwd
> $ cat passwd
>
>   SYSTEM:*:18:544:,S-1-5-18::
>   Administrators:*:544:544:,S-1-5-32-544::
>   Backup Operators:*:551:551:,S-1-5-32-551::
>   Guests:*:546:546:,S-1-5-32-546::
>   Power Users:*:547:547:,S-1-5-32-547::
>   Replicator:*:552:552:,S-1-5-32-552::
>   Users:*:545:545:,S-1-5-32-545::
>   Debugger Users:*:1002:1002:,S-1-5-21-1123561945-682003330-839522115-1002::
>   
> Administrator:unused_by_nt/2000/xp:500:513:U-SN2307128\Administrator,S-1-5-21-1123561945-682003330-839522115-500:/home/Administrator:/bin/bash
>   ASPNET:unused_by_nt/2000/xp:1001:513:ASP.NET Machine 
> Account,U-SN2307128\ASPNET,S-1-5-21-1123561945-682003330-839522115-1001:/home/ASPNET:/bin/bash
>   
> Guest:unused_by_nt/2000/xp:501:513:U-SN2307128\Guest,S-1-5-21-1123561945-682003330-839522115-501:/home/Guest:/bin/bash
>   
> micekiller:unused_by_nt/2000/xp:1000:513:micekiller,U-SN2307128\micekiller,S-1-5-21-1123561945-682003330-839522115-1000:/home/micekiller:/bin/bash

Ok so far, as long as you have no domain users...

> now I change my uid to 18

Ouch, not a good idea.

> $ cat passwd
> ..
> micekiller:unused_by_nt/2000/xp:18:18:micekiller,U-SN2307128\micekiller,S-1-5-21-1123561945-682003330-839522115-1000:/home/micekiller:/bin/bash
> ...
>
> restart cygwin, then
>
> $ whoami
>   SYSTEM

Nope.  You aren't really "SYSTEM", your SID (that string starting with S-)
is still that for U-SN2307128\micekiller.  Cygwin thinks your name is
SYSTEM, but it isn't.

Besides, you don't need to do that.  cygrunsrv will install services as
SYSTEM by default, regardless of the current user.

> $ cygrunsrv.exe -I cron -p /usr/sbin/cron.exe -a -D -d "damn cron" -e 
> "CYGWIN=ntsec"
>
> $ cygrunsrv.exe -S cron
> $ cygrunsrv.exe -Q cron
>   Service             : cron
>   Display name        : cygwin cron
>   Current State       : Running
>   Controls Accepted   : Stop
>   Command             : /usr/sbin/cron.exe -D
>
> $ crontab -l
>   # DO NOT EDIT THIS FILE - edit the master and reinstall.
>   # (/tmp/crontab.1200 installed on Fri Oct  7 18:26:04 2005)
>   # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $)
>   * 18 * * * /bin/date >> /usr/tmp/date.out 2>&1
>
> the /usr/tmp permission is
>
> $ ls -l /usr/
>   total 648
>   drwxrwxrwx+  2 Administrators SYSTEM      0 Oct  7 14:22 tmp
>   ...
>
> finally the cron.pid permission is
>
> $ ls -l /var/run/
>   total 6
>   -rwxrwxrwx  1 SYSTEM         root     5 Oct  7 18:23 cron.pid
>   -rwxrwxrwx  1 Administrators SYSTEM 616 Oct  7 18:20 utmp
>   -rw-r--r--  1 SYSTEM         SYSTEM  24 Oct  7 18:09 ~x
>
> I wait wait wait, but the /usr/tmp directory is always empty ...
>
> $ ls -l /usr/tmp/
>   total 0
>
> In my Application Log there are only message about LST, RELOAD, EDIT
> etc...
>
> I'm desperate :-)

Try doing this without changing your UID to 18.  In fact, is there a
reason why you didn't use cron-config in the first place?  Why not try
removing all traces of the cron service, including the log and pid files,
and using cron-config to install cron?
        Igor
-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            [EMAIL PROTECTED]
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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

Reply via email to