Larry/Igor - well - this is the first time I am participating in the
cygwin mailing list and from what I have read at http://ezmlm.org/ it is
supposed to add to threads if the subject is identical.  I have been
using the same subject line.  There was not an initial email that I
could have replied to nor was there a References: that I could have
manipulated when I started.  I read the responses by going to the site
http://cygwin.com/ml/cygwin/2004-09/ which just lists items
chronologically.  But, since it was not available night before last I
discovered the site http://www.mail-archive.com/[EMAIL PROTECTED]/ that
actually does have all my responses threaded correctly.  In fact, the
presentation is prefered since it is by thread/subject as opposed to by
date/time.  So, tell me what I am supposed to do such that responses are
correctly threaded and I will comply...

Igor - even though we did not state the command executed to add cron as
a service it did include the -D option as described in the message
http://www.mail-archive.com/[EMAIL PROTECTED]/msg31538.html.  Yes, we
have tried running it as you have described and it still fails with the
error: cron : PID 3784 : starting service `cron' failed: execv: 128,
Transport endpoint is not connected.  Also yes, you have correctly
pointed out that the -a is erroneous in my summation of steps.  I am
including an updated set of instructions just to ensure that any future
readers will not be mislead.

Pierre - your suggestion - will it not lead to root privileges for
svccron?  If yes, then that is not desirable.  However, I will try it
out and let all know the outcome.  In a bash shell with a simple command
it prompts for a password.

$ su -c "exec echo foobar" system
Password:
su: incorrect password

Thank you all once again.  Hopefully one of you can get it to work on
W2K3 without wrappers.


Regards,

Paul J. Ghosh

overview:
        - create local user called 'svccron'
        - set up permissions for local user
        - create wrappers for cron/crontab
        - add wrapped cron as service
        - set up schedules

execute the following within a bash shell:

        - create local user called 'svccron'

        net user svccron <passwd> /add /yes
        net localgroup <administrators_group_name> svccron /add
        editrights -a SeAssignPrimaryTokenPrivilege -u svccron
        editrights -a SeCreateTokenPrivilege -u svccron
        editrights -a SeIncreaseQuotaPrivilege -u svccron
        editrights -a SeServiceLogonRight -u svccron
        mkpasswd -l -u svccron >> /etc/passwd

        for security reasons:
        editrights -a SeDenyInteractiveLogonRight -u svccron
        editrights -a SeDenyNetworkLogonRight -u svccron
        editrights -a SeDenyRemoteInteractiveLogonRight -u svccron

        - create wrapper for cron - attached 'xcron'/contents below
        - install in /usr/sbin
        - change permissions for xcron
        $ chmod 744 /usr/sbin/xcron

        $ cat /usr/sbin/xcron
        #!/usr/bin/bash
        /usr/sbin/cron -D

        $ ls -l /usr/sbin/xcron
        -rwxr-xr-x    1 devadm   Domain U       34 Sep 10 14:03
/usr/sbin/xcron

        - create wrapper for crontab - attached 'xcrontab'/contents
below
        - install in /usr/bin
        - change permissions for xcrontab
        $ chmod 744 /usr/bin/xcrontab

        $ cat /usr/bin/xcrontab
        #!/usr/bin/bash
        /usr/bin/crontab $@;
        xval=$?;
        chmod 644 /var/cron/tabs/$USER;
        exit $xval;

        $ ls -l /usr/bin/xcrontab
        -rwxr-xr-x    1 devadm   Domain U       90 Sep 10 13:58
/usr/bin/xcrontab

        - add wrapped cron as service
        $ cygrunsrv -I xcron -p /usr/sbin/xcron -u svccron -w <passwd>

        - execute following as user for which tasks need to be scheduled
        $ xcrontab -e

        - for details
        $ man 5 crontab

Attachment: xcrontab
Description: Binary data

Attachment: xcron
Description: Binary data

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