Re: Cannot set up cron as a service on corporate PC

2023-12-12 Thread Adam Dinwoodie via Cygwin
On Mon, Dec 11, 2023 at 02:07:08PM +, Jon Turney wrote:
> On 09/12/2023 21:55, Adam Dinwoodie via Cygwin wrote:
> > Hi,
> > 
> > I've been trying to set up Cygwin cron to work as a service on my work
> > PC.  I'm able to get it working just fine on a Windows system where I'm
> > using a personal Microsoft account, but when I attempt the same process
> > using on a Windows system using my work account, I get the following
> > error:
> > 
> >  cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
> >  The dependency service or group failed to start.
> > 
> > I also note that in the failing scenario, I see the following log appear
> > at this time in Windows Event Viewer:
> > 
> > > This computer is configured as a member of a workgroup, not as a
> > > member of a domain. The Netlogon service does not need to run in this
> > > configuration.
> > 
> > I've reproduced this behaviour in virtual machines using fresh
> > installations of Windows, and where the only actions taken were to
> > bootstrap, log in, install Cygwin including cygrunsrv and cron, then
> > attempt to set up cron as a service.  I've attached copies of the MinTTY
> > output and the cronbug.txt files (which appear to include the normal
> > cygcheck -srv output, so I've not added those separately.  I've also
> > attached the full Event Viewer log
> > 
> > My guess is that something about how Windows manages user accounts has
> > changed over the years, and cygrunsrv hasn't been updated to cope, but
> > that's a very wild guess.  Searching the archives hasn't got me very
> 
> You might test this hypothesis by attempting to run 'true', or perhaps it
> needs to be something that runs forever like 'sleep infinity' and see if you
> get the same error about netlogon?
> 
> (Or are you able to run other cygwin services without problems?)

Good question!  Looks like this is common to all services installed with
cygrunsrv and a specific user:

# cygrunsrv -I sleeptest -p /usr/bin/sleep -a infinity -u EUROPE+adinwoodie
Enter password of user `EUROPE\adinwoodie':
Re-enter, please:

# cygrunsrv -Q sleeptest
Service : sleeptest
Current State   : Stopped
Command : /usr/bin/sleep infinity

# cygrunsrv -S sleeptest
cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
The dependency service or group failed to start.

So I think that strongly points towards either (a) an issue with
cygrunsrv, or (b) using usernames like this is just doomed to failure
and cron-config might benefit from suggesting better options or at least
warning there aren't any.

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cannot set up cron as a service on corporate PC

2023-12-11 Thread Jon Turney via Cygwin

On 09/12/2023 21:55, Adam Dinwoodie via Cygwin wrote:

Hi,

I've been trying to set up Cygwin cron to work as a service on my work
PC.  I'm able to get it working just fine on a Windows system where I'm
using a personal Microsoft account, but when I attempt the same process
using on a Windows system using my work account, I get the following
error:

 cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
 The dependency service or group failed to start.

I also note that in the failing scenario, I see the following log appear
at this time in Windows Event Viewer:


This computer is configured as a member of a workgroup, not as a
member of a domain. The Netlogon service does not need to run in this
configuration.


I've reproduced this behaviour in virtual machines using fresh
installations of Windows, and where the only actions taken were to
bootstrap, log in, install Cygwin including cygrunsrv and cron, then
attempt to set up cron as a service.  I've attached copies of the MinTTY
output and the cronbug.txt files (which appear to include the normal
cygcheck -srv output, so I've not added those separately.  I've also
attached the full Event Viewer log

My guess is that something about how Windows manages user accounts has
changed over the years, and cygrunsrv hasn't been updated to cope, but
that's a very wild guess.  Searching the archives hasn't got me very


You might test this hypothesis by attempting to run 'true', or perhaps 
it needs to be something that runs forever like 'sleep infinity' and see 
if you get the same error about netlogon?


(Or are you able to run other cygwin services without problems?)


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cannot set up cron as a service on corporate PC

2023-12-11 Thread Adam Dinwoodie via Cygwin
On Sun, Dec 10, 2023 at 09:22:12AM -0700, Brian Inglis via Cygwin wrote:
> On 2023-12-09 14:55, Adam Dinwoodie via Cygwin wrote:
> > I've been trying to set up Cygwin cron to work as a service on my work
> > PC.  I'm able to get it working just fine on a Windows system where I'm
> > using a personal Microsoft account, but when I attempt the same process
> > using on a Windows system using my work account, I get the following
> > error:
> >  cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
> >  The dependency service or group failed to start.
> > I also note that in the failing scenario, I see the following log appear
> > at this time in Windows Event Viewer:
> > > This computer is configured as a member of a workgroup, not as a
> > > member of a domain. The Netlogon service does not need to run in this
> > > configuration.
> > I've reproduced this behaviour in virtual machines using fresh
> > installations of Windows, and where the only actions taken were to
> > bootstrap, log in, install Cygwin including cygrunsrv and cron, then
> > attempt to set up cron as a service.  I've attached copies of the MinTTY
> > output and the cronbug.txt files (which appear to include the normal
> > cygcheck -srv output, so I've not added those separately.  I've also
> > attached the full Event Viewer log
> > My guess is that something about how Windows manages user accounts has
> > changed over the years, and cygrunsrv hasn't been updated to cope, but
> > that's a very wild guess.  Searching the archives hasn't got me very
> > far; mostly I've found references to cyglsa, which I get the impression
> > is thoroughly deprecated, and based on
> > https://www.cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3 I don't
> > think it's appropriate anyway due to the way the password is stored.
> > For now I'm continuing to use a snippet in my .bashrc to start cron when
> > I first start Bash, but that's not the nicest of workarounds.  Does
> > anyone have suggestions for anything better?
> 
> Never any issues here with cron, other than no mail, but I run mainly run
> scripts that log to /var/log/, and syslog rules that chmod a+r.
> I installed cyglsa many years ago, but don't think that's used any more, and
> I also used passwd -R, so that should still be around.
> I have also customized my daemon services so auto-start is delayed, notify
> on pre-shutdown, and depend on others: cron -> syslog-ng -> cygserver ->
> SamSS Security Accounts Manager, as I an not in a domain.
> 
> Given the error, I suggest checking the system config, as it either needs to
> be a domain member, with DC/AD access, or you need your work user created
> locally.

I'm honestly not sure what system config I'd need to check here.  Can
you give any more detailed instructions?

> Also check the deps with `sc qc cron` and follow the chain to see where
> netlogon gets involved.

That doesn't seem useful, sadly: as far as I can tell, cron has no
dependencies, so it's not clear to me why netlogon is getting involved
at all.

$ sc qc cron
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: cron
TYPE   : 10  WIN32_OWN_PROCESS
START_TYPE : 2   AUTO_START
ERROR_CONTROL  : 1   NORMAL
BINARY_PATH_NAME   : C:\cygwin64\bin\cygrunsrv.exe
LOAD_ORDER_GROUP   :
TAG: 0
DISPLAY_NAME   : Cron daemon
DEPENDENCIES   :
SERVICE_START_NAME : EUROPE\adinwoodie

I get the same results running that in Cygwin Bash and in PowerShell,
and with either started normally or running with Administrator
permissions.

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cannot set up cron as a service on corporate PC

2023-12-10 Thread Brian Inglis via Cygwin

On 2023-12-09 14:55, Adam Dinwoodie via Cygwin wrote:

I've been trying to set up Cygwin cron to work as a service on my work
PC.  I'm able to get it working just fine on a Windows system where I'm
using a personal Microsoft account, but when I attempt the same process
using on a Windows system using my work account, I get the following
error:
 cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
 The dependency service or group failed to start.
I also note that in the failing scenario, I see the following log appear
at this time in Windows Event Viewer:

This computer is configured as a member of a workgroup, not as a
member of a domain. The Netlogon service does not need to run in this
configuration.

I've reproduced this behaviour in virtual machines using fresh
installations of Windows, and where the only actions taken were to
bootstrap, log in, install Cygwin including cygrunsrv and cron, then
attempt to set up cron as a service.  I've attached copies of the MinTTY
output and the cronbug.txt files (which appear to include the normal
cygcheck -srv output, so I've not added those separately.  I've also
attached the full Event Viewer log
My guess is that something about how Windows manages user accounts has
changed over the years, and cygrunsrv hasn't been updated to cope, but
that's a very wild guess.  Searching the archives hasn't got me very
far; mostly I've found references to cyglsa, which I get the impression
is thoroughly deprecated, and based on
https://www.cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3 I don't
think it's appropriate anyway due to the way the password is stored.
For now I'm continuing to use a snippet in my .bashrc to start cron when
I first start Bash, but that's not the nicest of workarounds.  Does
anyone have suggestions for anything better?


Never any issues here with cron, other than no mail, but I run mainly run 
scripts that log to /var/log/, and syslog rules that chmod a+r.
I installed cyglsa many years ago, but don't think that's used any more, and I 
also used passwd -R, so that should still be around.
I have also customized my daemon services so auto-start is delayed, notify on 
pre-shutdown, and depend on others: cron -> syslog-ng -> cygserver -> SamSS 
Security Accounts Manager, as I an not in a domain.


Given the error, I suggest checking the system config, as it either needs to be 
a domain member, with DC/AD access, or you need your work user created locally.
Also check the deps with `sc qc cron` and follow the chain to see where netlogon 
gets involved.


--
Take care. Thanks, Brian Inglis  Calgary, Alberta, Canada

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Cannot set up cron as a service on corporate PC

2023-12-09 Thread Adam Dinwoodie via Cygwin
Hi,

I've been trying to set up Cygwin cron to work as a service on my work
PC.  I'm able to get it working just fine on a Windows system where I'm
using a personal Microsoft account, but when I attempt the same process
using on a Windows system using my work account, I get the following
error:

cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
The dependency service or group failed to start.

I also note that in the failing scenario, I see the following log appear
at this time in Windows Event Viewer:

> This computer is configured as a member of a workgroup, not as a
> member of a domain. The Netlogon service does not need to run in this
> configuration.

I've reproduced this behaviour in virtual machines using fresh
installations of Windows, and where the only actions taken were to
bootstrap, log in, install Cygwin including cygrunsrv and cron, then
attempt to set up cron as a service.  I've attached copies of the MinTTY
output and the cronbug.txt files (which appear to include the normal
cygcheck -srv output, so I've not added those separately.  I've also
attached the full Event Viewer log

My guess is that something about how Windows manages user accounts has
changed over the years, and cygrunsrv hasn't been updated to cope, but
that's a very wild guess.  Searching the archives hasn't got me very
far; mostly I've found references to cyglsa, which I get the impression
is thoroughly deprecated, and based on
https://www.cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3 I don't
think it's appropriate anyway due to the way the password is stored.

For now I'm continuing to use a snippet in my .bashrc to start cron when
I first start Bash, but that's not the nicest of workarounds.  Does
anyone have suggestions for anything better?
EUROPE+adinwoodie@CygwinCronSTC ~
$ cron-config
The cron daemon can run as a service or as a job. The latter is not recommended.
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ]

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
   This gives access to all network drives but only allows you as user.
To run multiple users, cron must change user context without knowing
  the passwords. There are three methods to do that, as explained in
  http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
If all the cron users have executed "passwd -R" (see man passwd),
  which provides access to network drives, or if you are using the
  cyglsa package, then cron should run under the local system account.
Otherwise you need to have or to create a privileged account.
  This script will help you do so.
Do you want the cron daemon to run as yourself? (yes/no) yes

Please enter the password for user 'EUROPE+adinwoodie':
Reenter:
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
cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
The dependency service or group failed to start.


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.

WARNING: PATH may be set differently under cron than in interactive shells.
 Names such as "find" and "date" may refer to Windows programs.


EUROPE+adinwoodie@CygwinCronSTC ~
$ cp /dev/clipboard event_details.txt

EUROPE+adinwoodie@CygwinCronSTC ~
$ /usr/bin/cronbug

This script produces an error report for cron.
Please run it while the cron service is running (if possible).
Send cronbug.txt as an attachment to cygwin@cygwin.com
mentioning "cron" in the Subject line
and describing the problem you observe.
Do you want to continue? (yes/no) yes

The report is written to the file ./cronbug.txt
ls: cannot access '/var/cron/tabs/*': No such file or directory
ls: cannot access '/var/cron/tabs/*': No such file or directory
no crontab for EUROPE+adinwoodie

EUROPE+adinwoodie@CygwinCronSTC ~
$ ls /var/log
setup.log  setup.log.full

adam@CygwinCronGood ~
$ cron-config
The cron daemon can run as a service or as a job. The latter is not recommended.
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ]

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
   This gives

Re: cron: trying and totally failing to run a simple cron job - fixed (with comments)

2023-05-23 Thread Jonathan Clark via Cygwin

I got this running. In the hope that it may help others, I give some details 
here.

It turned out that I was on the right track - it *was* the space in my Windows 
username which was making cron complain. The simple addition of a (basically 
completely fake but plausible) MAILTO line in the crontab got past the UNSAFE 
and the cron job started working, more or less. Brian also mentioned that he 
used a MAILTO, which was helpful. Thanks!

That was not quite the end of the story. With the cron job working, I went 
looking for the output.
I couldn't use a real email address in the MAILTO because I don't know how to persuade sendmail to 
use the SMTP SUBMIT protocol (anyone?), but it took me some time to find the cron.log file, which 
was hiding in "/cygdrive/c/cygwin64/home/Jonathan Clark". I didn't even know that 
directory existed, so this was all terribly exciting. Setting HOME in the crontab to my 
"real" HOME (or at least somewhere I could remember to look) solved that problem.

While poking around Vixie's source code I ran across this bug fix:
https://github.com/vixie/cron/commit/690fc534c7316e2cf6ff16b8e83ba7734b5186d2
which I am fairly sure explains my observation of the delay in picking up a 
changed crontab.

Anyway, thanks for the help! And thanks again to everyone for the work on 
cygwin.

Jonathan


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: cron: trying and totally failing to run a simple cron job

2023-05-23 Thread Jonathan Clark via Cygwin

Hi Brian:

Thank you for your response.

On 23/05/2023 17:44, Brian Inglis wrote:

On 2023-05-23 13:46, Jonathan Clark via Cygwin wrote:

First off, many thanks to everyone who is putting in time and effort in making 
cygwin as wonderful as it is.

I'm trying to get what I think is a simple cron job working. So far all I've 
gotten is frustrated and confused. I'm sure I'm doing something stupid 
(probably more than one thing), but I don't know what. At this point I have 
tried many different twiddles and fiddles and so on, with no positive results. 
Any help gratefully accepted.

I am familiar with cron and crontabs on various flavours of UNIX, but this is 
my first attempt at getting a cron job working on cygwin.

I have DLed the cron package and gotten it running (possibly wrongly...).

There are no cron.allow nor cron.deny files that I can find.

I have set up a crontab which looks correct to me. I have tried many variants 
of the actual command - adding a specific shell invocation (having read 
somewhere that this needs to be a .exe file). The target script works just fine 
when invoked by hand. I have ensured that the crontab file is written in UNIX 
format. I have messed around with file permissions so that the target script is 
not writable, even by me.

However, nothing works. Either:

a) nothing is ever invoked - cronevents shows that the new crontab is loaded, 
but there's nothing there which shows that the specified command is ever run;

OR

b) I get a gnomic message about the crontab being UNSAFE.

I have a sneaking suspicion that the space in my Windows username may be the 
cause of the UNSAFE.

Along the way I have fallen over various other curiosities.

'crontab -u' just says "must be privileged", even though I'm running it from an 
Administrator account.

cron-config talks about using 'passwd -R'  as an option, but when I try this 
all I get is:
"Storing password failed: Function not implemented" which is unhelpful.

Apart from exhaustive search, there doesn't seem to be any way to search the 
cygwin mailing list archives - is there such a facility hidden somewhere?

Any help appreciated! cronbug.txt attached


Hi JC,

You do not appear to be running cron!


You are right! Or at you *were* right - at the time I ran cronbug, cron must 
have died, or I accidentally killed it, or something. I did mention that I had 
gotten confused :-) Anyway, it's clear from the logfiles that it *has* been 
running in the past. Attached is a newly generated cronbug output which should 
be accurate.


Did you set up by running `/usr/sbin/cron-config` from an elevated admin shell 
and starting with the default answers?


Yes, exactly that.


I would avoid trying `crontab -u USER` under Cygwin as ideas of admin don't 
match.


Indeed so. I am happy to avoid that one.


I or config script created empty /var/cron/cron.deny to allow all users (me) to 
use cron.


I tried both ways - with and without cron.deny. I have the same (failing) 
result either way (which is exactly what I would expect).


I started off using `crontab -e` and `crontab -l > ~/$USER.crontab` to update 
and save, but now just edit ~/$USER.crontab then `crontab ~/$USER.crontab` to 
reload.


I use 'crontab -e' out of habit, but the effect should be the same.


and never try running anything but non-elevated Cygwin scripts and commands.


Same thing here - no elevated scripts.

Anyway, I put in the absolute simplest cron job I could think of:
* * * * *   /bin/echo Hello

This fails reliably with the UNSAFE log entry:
2023/05/23 18:19:01 [Jonathan Clark] /usr/sbin/cron: PID 2627: (Jonathan Clark) 
CMD (/bin/echo Hello)
2023/05/23 18:19:01 [Jonathan Clark] /usr/sbin/cron: PID 2626: (Jonathan Clark) 
UNSAFE (Jonathan Clark)

So I'm still completely stuck.

I did notice one oddity while messing around with the above. The test job goes 
off every minute, at zero seconds. However, at least according to cronevents, 
it takes an entire minute for cron to change to a new crontab. IE the sequence 
is:

1) update crontab
2) zero seconds reached, *old* cron job executed
3) 60 seconds pass, only now is *new* cron job executed.

Here's the terminal screendump, while running 'crontab -e' I merely changed the command from 
"/bin/echo Hello" to "/bin/echo Hello There".
--
w10$ crontab -e
crontab: installing new crontab
w10$ date
Tue, May 23, 2023  6:27:47 PM
w10$ sleep 15; cronevents | tail -5
2023/05/23 18:27:43 [Jonathan Clark] crontab: PID 2648: (Jonathan Clark) 
REPLACE (Jonathan Clark)
2023/05/23 18:27:43 [Jonathan Clark] crontab: PID 2648: (Jonathan Clark) END 
EDIT (Jonathan Clark)
2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2554: (Jonathan Clark) 
RELOAD (tabs/Jonathan Clark)
2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2652: (Jonathan Clark) 
CMD (/bin/echo Hello)
2023/05/23 18:28:

Re: cron: trying and totally failing to run a simple cron job

2023-05-23 Thread Brian Inglis via Cygwin

On 2023-05-23 13:46, Jonathan Clark via Cygwin wrote:
First off, many thanks to everyone who is putting in time and effort in making 
cygwin as wonderful as it is.


I'm trying to get what I think is a simple cron job working. So far all I've 
gotten is frustrated and confused. I'm sure I'm doing something stupid (probably 
more than one thing), but I don't know what. At this point I have tried many 
different twiddles and fiddles and so on, with no positive results. Any help 
gratefully accepted.


I am familiar with cron and crontabs on various flavours of UNIX, but this is my 
first attempt at getting a cron job working on cygwin.


I have DLed the cron package and gotten it running (possibly wrongly...).

There are no cron.allow nor cron.deny files that I can find.

I have set up a crontab which looks correct to me. I have tried many variants of 
the actual command - adding a specific shell invocation (having read somewhere 
that this needs to be a .exe file). The target script works just fine when 
invoked by hand. I have ensured that the crontab file is written in UNIX format. 
I have messed around with file permissions so that the target script is not 
writable, even by me.


However, nothing works. Either:

a) nothing is ever invoked - cronevents shows that the new crontab is loaded, 
but there's nothing there which shows that the specified command is ever run;


OR

b) I get a gnomic message about the crontab being UNSAFE.

I have a sneaking suspicion that the space in my Windows username may be the 
cause of the UNSAFE.


Along the way I have fallen over various other curiosities.

'crontab -u' just says "must be privileged", even though I'm running it from an 
Administrator account.


cron-config talks about using 'passwd -R'  as an option, but when I try this all 
I get is:

"Storing password failed: Function not implemented" which is unhelpful.

Apart from exhaustive search, there doesn't seem to be any way to search the 
cygwin mailing list archives - is there such a facility hidden somewhere?


Any help appreciated! cronbug.txt attached


Hi JC,

You do not appear to be running cron!

Did you set up by running `/usr/sbin/cron-config` from an elevated admin shell 
and starting with the default answers?


I would avoid trying `crontab -u USER` under Cygwin as ideas of admin don't 
match.

I or config script created empty /var/cron/cron.deny to allow all users (me) to 
use cron.


I started off using `crontab -e` and `crontab -l > ~/$USER.crontab` to update 
and save, but now just edit ~/$USER.crontab then `crontab ~/$USER.crontab` to 
reload.


In my crontab I set:

PATH=/usr/local/bin:/home/$LOGNAME/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
MAILTO=...@...

and never try running anything but non-elevated Cygwin scripts and commands.

I also run cygserver, and syslog-ng with some tweaks, to avoid dealing with 
Windows event logs.


[To run elevated Cygwin or Windows scripts and commands, I use Windows Scheduled 
Tasks with the SYSTEM account, whether logged in or not, with highest 
privileges, running Windows %CYGWIN_ROOT%\bin\sh ... with script args or any 
other command, making no assumptions about any current directory or user mounts.]


--
Take care. Thanks, Brian Inglis  Calgary, Alberta, Canada

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


cron: trying and totally failing to run a simple cron job

2023-05-23 Thread Jonathan Clark via Cygwin

Hi there:

First off, many thanks to everyone who is putting in time and effort in making 
cygwin as wonderful as it is.

I'm trying to get what I think is a simple cron job working. So far all I've 
gotten is frustrated and confused. I'm sure I'm doing something stupid 
(probably more than one thing), but I don't know what. At this point I have 
tried many different twiddles and fiddles and so on, with no positive results. 
Any help gratefully accepted.

I am familiar with cron and crontabs on various flavours of UNIX, but this is 
my first attempt at getting a cron job working on cygwin.

I have DLed the cron package and gotten it running (possibly wrongly...).

There are no cron.allow nor cron.deny files that I can find.

I have set up a crontab which looks correct to me. I have tried many variants 
of the actual command - adding a specific shell invocation (having read 
somewhere that this needs to be a .exe file). The target script works just fine 
when invoked by hand. I have ensured that the crontab file is written in UNIX 
format. I have messed around with file permissions so that the target script is 
not writable, even by me.

However, nothing works. Either:

a) nothing is ever invoked - cronevents shows that the new crontab is loaded, 
but there's nothing there which shows that the specified command is ever run;

OR

b) I get a gnomic message about the crontab being UNSAFE.

I have a sneaking suspicion that the space in my Windows username may be the 
cause of the UNSAFE.

Along the way I have fallen over various other curiosities.

'crontab -u' just says "must be privileged", even though I'm running it from an 
Administrator account.

cron-config talks about using 'passwd -R'  as an option, but when I try this 
all I get is:
"Storing password failed: Function not implemented" which is unhelpful.

Apart from exhaustive search, there doesn't seem to be any way to search the 
cygwin mailing list archives - is there such a facility hidden somewhere?

Any help appreciated! cronbug.txt attached

Jonathan
Current version
-rwxr-xr-x 1 Jonathan Clark None 5304 Feb 15  2010 
/usr/share/doc/Cygwin/cron-4.1-65.README

Running crons:
None

Sendmail:
lrwxrwxrwx 1 Jonathan Clark None 16 Apr 22  2021 /usr/sbin/sendmail -> 
/usr/bin/cronlog

Crontabs:
-rw-r-+ 1 jhcAdministrators 251 May 23 14:58 /var/cron/tabs/jhc
-rw-r-+ 1 Jonathan Clark Administrators 231 May 23 15:33 
/var/cron/tabs/Jonathan Clark
-rw-r-+ 1 197610 544 251 May 23 14:58 /var/cron/tabs/jhc
-rw-r-+ 1 197609 544 231 May 23 15:33 /var/cron/tabs/Jonathan Clark

cron.log:
-rwxr--r--+ 1 SYSTEM SYSTEM 0 May 23 14:46 /var/log/cron.log

cron.pid:
-rwxr--r--+ 1 SYSTEM SYSTEM 5 May 23 14:46 /var/run/cron.pid

Crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.pMEbeIQKBY installed on Tue May 23 15:33:40 2023)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
34 15 * * * $HOME/bin/backup

Windows Application Events log:
2023/05/22 16:04:06 [Jonathan Clark] crontab: PID 1137: (Jonathan Clark) LIST 
(Jonathan Clark)
2023/05/22 16:04:12 [Jonathan Clark] crontab: PID 1138: (Jonathan Clark) BEGIN 
EDIT (Jonathan Clark)
2023/05/22 16:04:15 [Jonathan Clark] crontab: PID 1138: (Jonathan Clark) END 
EDIT (Jonathan Clark)
2023/05/22 21:36:40 [Jonathan Clark] crontab: PID 1707: (Jonathan Clark) BEGIN 
EDIT (Jonathan Clark)
2023/05/22 21:37:37 [Jonathan Clark] crontab: PID 1707: (Jonathan Clark) 
REPLACE (Jonathan Clark)
2023/05/22 21:37:37 [Jonathan Clark] crontab: PID 1707: (Jonathan Clark) END 
EDIT (Jonathan Clark)
2023/05/22 21:48:30 [Jonathan Clark] /usr/sbin/cron: PID 2014: (CRON) STARTUP 
(V5.0)
2023/05/22 21:48:31 [Jonathan Clark] cron: PID 2013: `cron' service started
2023/05/23 04:00:01 [Jonathan Clark] /usr/sbin/cron: PID 2031: (Jonathan Clark) 
CMD ($HOME/bin/backup)
2023/05/23 04:00:01 [Jonathan Clark] /usr/sbin/cron: PID 2030: (Jonathan Clark) 
UNSAFE (Jonathan Clark)
2023/05/23 12:04:57 [Jonathan Clark] crontab: PID 2037: (Jonathan Clark) LIST 
(Jonathan Clark)
2023/05/23 12:05:20 [Jonathan Clark] crontab: PID 2038: (Jonathan Clark) BEGIN 
EDIT (Jonathan Clark)
2023/05/23 12:05:30 [Jonathan Clark] crontab: PID 2038: (Jonathan Clark) END 
EDIT (Jonathan Clark)
2023/05/23 12:06:07 [Jonathan Clark] crontab: PID 2040: (Jonathan Clark) BEGIN 
EDIT (Jonathan Clark)
2023/05/23 12:06:34 [Jonathan Clark] crontab: PID 2040: (Jonathan Clark) 
REPLACE (Jonathan Clark)
2023/05/23 12:06:34 [Jonathan Clark] crontab: PID 2040: (Jonathan Clark) END 
EDIT (Jonathan Clark)
2023/05/23 12:07:01 [Jonathan Clark] /usr/sbin/cron: PID 2014: (Jonathan Clark) 
RELOAD (tabs/Jonathan Clark)
2023/05/23 12:10:01 [Jonathan Clark] /usr/sbin/cron: PID 2043: (Jonathan Clark) 
CMD (ksh -c $HOME/bin/backup)
2023/05/23 12:10:01 [Jonathan Clark] /usr/sbin/cron: PID 2042: (Jonathan Clark) 
UNSAFE (Jonathan Clark)
2023

Re: cron problem -- can't switch user context

2021-07-19 Thread Brian Inglis

On 2021-07-19 11:40, Jeremy Hetzler via Cygwin wrote:

Upon installing Cygwin and cron on a new Windows Server 2019 machine,
we are unable to get cron to work.

I installed cron using cron-config. Cron is configured to run under
account cyg_server, which cron-config set up. cron-config reported
that "cyg_server is a valid privileged account".


From cronevents, I see numerous errors saying "can't switch user

context". It looks like every time cron tries to run a job, it emits
one of these errors.

Example:

2021/07/15 18:45:02 [cyg_server] /usr/sbin/cron: PID 6421: (CRON) error (can't 
switch user context)


See attached for cronbug output.

I tried rebooting the machine, but this did not help.

How can we get cron to work on this new machine?

Please copy me on any responses; thank you.


Use the recommended local System account and you should have no problems 
with recent Cygwin services under recent Windows:


"To run multiple users, cron must change user context without knowing 
the passwords. There are three methods to do that, as explained in


http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1

If all the cron users have executed "passwd -R" (see man passwd),
which provides access to network drives, or if you are using the
[obsolete] cyglsa package, then cron should run under the
local system account."

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Using /etc/cron.{daily, weekly, monthly} on Cygwin (/usr/bin/run-parts)

2021-06-09 Thread Joe Smith via Cygwin
Please add 'run-parts' to Cygwin.  I have been using the attached program
(copied from Debian) successfully with Vista, Windows-7, and Windows-10.

mintty screen dump

#!/bin/bash
# Name: /usr/bin/run-parts  Modified by Joe Smith (joeinwap,gmail)
# Purpose: Runs jobs sequentially at regular intervals (daily,weekly,monthly)
# Concept taken from Debian, copied from RHEL-5, modified for Cygwin.
# See end for "How to run cron jobs with elevated privs on Cygwin".

### Set ENV to run under Windows Task Scheduler ###
export SHELL=/bin/bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
export MAILTO=root  # See also /etc/ssmtp/ssmtp.conf
export HOME=/root
export USER=root

# keep going when something fails
set +e

if [ $# -lt 1 ]; then
echo "Usage: run-parts "
exit 1
fi

if [ ! -d $1 ]; then
echo "Not a directory: $1"
exit 1
fi

### Log STDOUT and STDERR since Task Scheduler is not the same as crond.
LOGFILE=/var/log/cron.log
TMPFILE=/var/log/run-parts.log
exec >$TMPFILE 2>&1

# Ignore *~ and *, scripts
start_time=`date`
for i in $1/*[^~,] ; do
[ -d $i ] && continue
# Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
[ "${i%.rpmsave}" != "${i}" ] && continue
[ "${i%.rpmorig}" != "${i}" ] && continue
[ "${i%.rpmnew}" != "${i}" ] && continue
[ "${i%.swp}" != "${i}" ] && continue
[ "${i%,v}" != "${i}" ] && continue

if [ -x $i ]; then
$i 2>&1 | awk -v "progname=$i" \
  'progname {
   print progname ":\n"
   progname="";
   }
   { print; }'
fi
done
end_time=`date` # Merge tmp log with /var/log/cron

if [ -s $TMPFILE ]; then
  echo "Started: $start_time"   >> $LOGFILE
  cat   $TMPFILE>> $LOGFILE
  echo "Finished: $end_time">> $LOGFILE
  echo ""   >> $LOGFILE
  :   > $TMPFILE
fi

exit 0

cat <<'EOM'
"How to run cron jobs with elevated privs on Cygwin".

This procedure has been used with Cygwin running on Vista or Windows 7, 10.

# Here is an example of a Linux-style /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
#1  * * * * root run-parts /etc/cron.hourly
02 22 * * * root run-parts /etc/cron.daily
22 22 * * 0 root run-parts /etc/cron.weekly
42 22 1 * * root run-parts /etc/cron.monthly

###

The second column (hours) is 4 for Linux, which is fine for servers, but
for laptops, values like 0 (midnight) or 22 (10pm) may be more appropriate.

Start -> All Programs -> Accessories -> System Tools -> Task Scheduler

Task Scheduler: Create Basic Task (do this 3 times)
  Name: cron-daily, cron-weekly, or cron-monthly
  Description: Runs cygwin programs with elevated privs.
Trigger:
  Daily,   10:02:00pm, recur every 1 days
  Weekly,  10:22:00pm, recur every 1 weeks on Sunday
  Monthly, 10:42:00pm, recur all months on the 1st
Action: Start a program
  Program:   C:\cygwin64\bin\bash.exe
  Arguments: /usr/bin/run-parts /etc/cron.daily
 or: /usr/bin/run-parts /etc/cron.weekly
 or: /usr/bin/run-parts /etc/cron.monthly
  Start in:  C:\cygwin64\bin
Finish: Open the Properties dialog when finished.
General:
  Run whether user is logged on or not
  Do not store password
  Run with highest privileges
Conditions:
  Wake the computer to run this task
Settings:
  Run task as soon as possible after a scheduled start is missed
  Stop the task if it runs longer than: 1 hour

Populate the directories with shell scripts or symlinks to binaries.
ln -s /usr/bin/updatedb /etc/cron.daily

I used "ln -s /usr/bin/run-parts /etc/cron-parts" so that this
file can be easily found using "ls -l /etc/cron*".


   joeinwap,gmail
EOM

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron can't switch user context

2021-04-27 Thread Andrey Repin
Greetings, Brian Inglis!

>> We are aware that there are many tutorials and Q&A on the net which deal with
>> exactly this subject. However, none of the proposed solutions worked for us.

The one Q&A should have get you started: since Cygwin 3.1 (IIRC, may be
earlier), the core was changed to use LocalSystem account and some new(-ish)
facilities only available in Windows 7 and up to rebuild auth user token
without using CygLSA or what not.
This affecting SSHD, Cron and any other Cygwin daemon dealing with user
authorization.

>> We would be very glad if you could give us some hints how to solve the 
>> problem.

>> P.S. Please note that /var/log/cron.log and /home/Administrator/cron.log are 
>> both empty, so we didn't attach them.

> I changed mine to run under LocalSystem account when system upgraded, had 
> cyglsa
> installed previously (not used now I believe), and set passwd -R for account.
> Don't forget to either set PATH to scripts in crontab or set for system before
> cygrunsrv starts cron as a Windows service.


-- 
With best regards,
Andrey Repin
Wednesday, April 28, 2021 7:28:14

Sorry for my terrible english...


-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron can't switch user context

2021-04-27 Thread Brian Inglis

On 2021-04-27 04:37, Peter Pfannenschmid wrote:
However, today we have run into an issue with cron. Please see the attached logs 
for details.


Additional notes:

- O/S is Windows Server 2019 Standard x64

- The cyg_server user has been created by cron-config, and we didn't change 
anything in that user's configuration afterwards. However, we have verified that 
this user has sufficient privileges (Replace a process level token, Log on as a 
service, Create a token object, Be part of the Administrators group).


- We did some tests with cron-config. We always stopped the Cygwin Cron Service 
before running cron-config. We always answered con-config's question the same, 
except the question "Enter the value of CYGWIN for the daemon". We don't know 
what this is about, so we first let it at the default value, just hitting Enter. 
In the next try, we answered "netsec" and hit Enter (as found on stackoverflow). 
In the third try, we answered "binmode netsec" and hit Enter (as found on the 
Oracle website).


However, the behavior was the same regardless of what answer we had given there.

- Our goal is to run the Cygwin cron daemon as a Windows service, to have that 
Windows service log on as "cyg_server" (not "Administrator" or "System), and to 
let the cron daemon execute crontabs from different users (including the user 
"Administrator").


The service is starting and reads Administrator's crontab, but when trying to 
execute the entries, it can't do that and errors out with "(CRON) error (can't 
switch user context)". We haven't installed crontabs for other users yet, 
because the crontab of Administrator is the most important one, so we'd like to 
concentrate on solving that problem first.


We are aware that there are many tutorials and Q&A on the net which deal with 
exactly this subject. However, none of the proposed solutions worked for us.


We would be very glad if you could give us some hints how to solve the problem.


P.S. Please note that /var/log/cron.log and /home/Administrator/cron.log are 
both empty, so we didn't attach them.


I changed mine to run under LocalSystem account when system upgraded, had cyglsa 
installed previously (not used now I believe), and set passwd -R for account.
Don't forget to either set PATH to scripts in crontab or set for system before 
cygrunsrv starts cron as a Windows service.


Start by running a simple test script to create some date-time dependent 
variable file name at some minute so you can change that to get it run immediately.
It won't run again for an hour, which gives you time to tweak your setup, and 
change the crontab to run it the next minute.


--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Cron can't switch user context

2021-04-27 Thread Peter Pfannenschmid

Dear ladies and gentlemen,

thank you very much for providing the Cygwin DLL and ecosystem. We are using it 
since many years without any problem.

However, today we have run into an issue with cron. Please see the attached 
logs for details.

Additional notes:

- O/S is Windows Server 2019 Standard x64

- The cyg_server user has been created by cron-config, and we didn't change 
anything in that user's configuration afterwards. However, we have verified 
that this user has sufficient privileges (Replace a process level token, Log on 
as a service, Create a token object, Be part of the Administrators group).

- We did some tests with cron-config. We always stopped the Cygwin Cron Service before running cron-config. 
We always answered con-config's question the same, except the question "Enter the value of CYGWIN for 
the daemon". We don't know what this is about, so we first let it at the default value, just hitting 
Enter. In the next try, we answered "netsec" and hit Enter (as found on stackoverflow). In the 
third try, we answered "binmode netsec" and hit Enter (as found on the Oracle website).

However, the behavior was the same regardless of what answer we had given 
there.


- Our goal is to run the Cygwin cron daemon as a Windows service, to have 
that Windows service log on as "cyg_server" (not "Administrator" or "System), and to let the cron daemon execute crontabs from different users (including the user "Administrator").


The service is starting and reads Administrator's crontab, but when trying to execute the entries, it can't do that and errors out with "(CRON) error (can't switch user context)". We haven't installed crontabs for other 
users yet, because the crontab of Administrator is the most important one, so we'd like to concentrate on solving that problem first.


We are aware that there are many tutorials and Q&A on the net which deal with exactly this subject. However, none of the proposed solutions worked 
for us.


We would be very glad if you could give us some hints how to solve the problem.

Thank you very much,

Peter

P.S. Please note that /var/log/cron.log and /home/Administrator/cron.log are 
both empty, so we didn't attach them.
$ cron-config
The cron daemon can run as a service or as a job. The latter is not recommended.
Cron is already installed as a service under account .\cyg_server.
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: [ ] binmode ntsec

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
   This gives access to all network drives but only allows you as user.
To run multiple users, cron must change user context without knowing
  the passwords. There are three methods to do that, as explained in
  http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
If all the cron users have executed "passwd -R" (see man passwd),
  which provides access to network drives, or if you are using the
  cyglsa package, then cron should run under the local system account.
Otherwise you need to have or to create a privileged account.
  This script will help you do so.
Do you want the cron daemon to run as yourself? (yes/no) no

Were the passwords of all cron users saved with "passwd -R", or
are you using the cyglsa package ? (yes/no) no

Finding or creating a privileged user.
The following accounts were found: 'cyg_server' .
This script plans to use account cyg_server.
Do you want to use another privileged account name? (yes/no) no

Account cyg_server already exists. Checking its privileges.
INFO: cyg_server is a valid privileged account.
INFO: The cygwin user name for account cyg_server is cyg_server.

Please enter the password for user 'cyg_server':
Reenter:
Running cron_diagnose ...
... 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.

WARNING: PATH may be set differently under cron than in interactive shells.
 Names such as "find" and "date" may refer to Windows programs.
2021/04/27 11:57:23 [cyg_server] /usr/sbin/cron: PID 2764: (CRON) STARTUP (V5.0)
2021/04/27 11:57:24 [cyg_server] cron: PID 2763: `cron' service star

Re: Cron installation issue

2020-09-02 Thread Anantha . Kumar
Hi Marco,

You must run service config scripts from an elevated admin shell.
Yes, I have executed using elevated admin shell but the same error I am getting.




Thanks,

Anantha Kumar

Platform Support

Elait
 Mobile: +91 9600406739

 Email :   anantha.ku...@elait.com<mailto:anantha.ku...@elait.com>

P Please consider the environment before printing this e-mail. Thank you.

Unless otherwise stated, the content of this email is confidential and intended 
for the specified recipient. Please seek permission in advance before sharing 
any of its contents. If received in error; please reply so we are aware and 
delete it.

<mailto:anantha.ku...@elait.com>



From: marco atzeri 
Sent: Wednesday, September 2, 2020 3:05 PM
To: Anantha.Kumar 
Cc: cygwin@cygwin.com 
Subject: Re: Cron installation issue

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Wed, Sep 2, 2020 at 11:13 AM Anantha.Kumar  wrote:
>
> Hi Team,
>
> Do you have any advice on this failure.

Again:
You must run service config scripts from an elevated admin shell.

It seems very simple to me. Or do you not understand its meaning ?

Regards
Marco
This E-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return E-mail.

Confidential
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron installation issue

2020-09-02 Thread marco atzeri via Cygwin
On Wed, Sep 2, 2020 at 11:13 AM Anantha.Kumar  wrote:
>
> Hi Team,
>
> Do you have any advice on this failure.

Again:
You must run service config scripts from an elevated admin shell.

It seems very simple to me. Or do you not understand its meaning ?

Regards
Marco
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron installation issue

2020-09-02 Thread Anantha . Kumar
Hi Team,

Do you have any advice on this failure.




Thanks,

Anantha Kumar

Platform Support

Elait
 Mobile: +91 9600406739

 Email :   anantha.ku...@elait.com<mailto:anantha.ku...@elait.com>

P Please consider the environment before printing this e-mail. Thank you.

Unless otherwise stated, the content of this email is confidential and intended 
for the specified recipient. Please seek permission in advance before sharing 
any of its contents. If received in error; please reply so we are aware and 
delete it.

<mailto:anantha.ku...@elait.com>



From: Anantha.Kumar 
Sent: Tuesday, September 1, 2020 5:47 PM
To: cygwin@cygwin.com ; brian.ing...@systematicsw.ab.ca 

Subject: Re: Cron installation issue

Hi Brain,

Yes, I was trying to run through admin shell but still facing this issue.



Thanks,

Anantha Kumar

Platform Support

Elait
 Mobile: +91 9600406739

 Email :   anantha.ku...@elait.com<mailto:anantha.ku...@elait.com>

P Please consider the environment before printing this e-mail. Thank you.

Unless otherwise stated, the content of this email is confidential and intended 
for the specified recipient. Please seek permission in advance before sharing 
any of its contents. If received in error; please reply so we are aware and 
delete it.

<mailto:anantha.ku...@elait.com>



From: Brian Inglis 
Sent: Friday, August 28, 2020 7:34 PM
To: cygwin@cygwin.com 
Cc: Anantha.Kumar 
Subject: Re: Cron installation issue

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On 2020-08-28 03:35, Anantha.Kumar wrote:
> I am facing some issue while installing cron as a windows service. I have
> attached the error message and cronbug output. Could you please help us on
> this issue?

> Do you want to start the cron daemon as a service now? (yes/no) yes
> cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
> The service has not been started.


You must run service config scripts from an elevated admin shell.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
This E-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return E-mail.

Confidential
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron installation issue

2020-09-01 Thread Anantha . Kumar
Hi Brain,

Yes, I was trying to run through admin shell but still facing this issue.



Thanks,

Anantha Kumar

Platform Support

Elait
 Mobile: +91 9600406739

 Email :   anantha.ku...@elait.com<mailto:anantha.ku...@elait.com>

P Please consider the environment before printing this e-mail. Thank you.

Unless otherwise stated, the content of this email is confidential and intended 
for the specified recipient. Please seek permission in advance before sharing 
any of its contents. If received in error; please reply so we are aware and 
delete it.

<mailto:anantha.ku...@elait.com>



From: Brian Inglis 
Sent: Friday, August 28, 2020 7:34 PM
To: cygwin@cygwin.com 
Cc: Anantha.Kumar 
Subject: Re: Cron installation issue

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On 2020-08-28 03:35, Anantha.Kumar wrote:
> I am facing some issue while installing cron as a windows service. I have
> attached the error message and cronbug output. Could you please help us on
> this issue?

> Do you want to start the cron daemon as a service now? (yes/no) yes
> cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
> The service has not been started.


You must run service config scripts from an elevated admin shell.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
This E-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return E-mail.

Confidential
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cron installation issue

2020-08-28 Thread Brian Inglis


On 2020-08-28 03:35, Anantha.Kumar wrote:
> I am facing some issue while installing cron as a windows service. I have 
> attached the error message and cronbug output. Could you please help us on
> this issue?

> Do you want to start the cron daemon as a service now? (yes/no) yes
> cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
> The service has not been started.


You must run service config scripts from an elevated admin shell.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Cron installation issue

2020-08-28 Thread Anantha . Kumar
Hi Team,

I am facing some issue while installing cron as a windows service. I have 
attached the error message and cronbug output. Could you please help us on this 
issue?

/home/_PSCGRM.ABInitioTst> cron-config
Cron is already installed as a service under account DEVINT\_PSCGRM.ABInitioTst.
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]

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.
On Windows2003 the SYSTEM account cannot setuid to other users.
You need to have or to create a privileged account.
This script will help you do so.
Do you want to the cron daemon to run as yourself? (yes/no) yes

Please enter the password for user '_PSCGRM.ABInitioTst':
Reenter:
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
cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
The service has not been started.


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.




Thanks,

Anantha Kumar

Platform Support

Elait
 Mobile: +91 9600406739

 Email :   anantha.ku...@elait.com<mailto:anantha.ku...@elait.com>

P Please consider the environment before printing this e-mail. Thank you.

Unless otherwise stated, the content of this email is confidential and intended 
for the specified recipient. Please seek permission in advance before sharing 
any of its contents. If received in error; please reply so we are aware and 
delete it.

<mailto:anantha.ku...@elait.com>


This E-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return E-mail.

Confidential

Current version

Running crons:
None

Sendmail:
lrwxrwxrwx 1 _PSCGRM.ABInitioTst Domain Users 16 Aug 11  2017 
/usr/sbin/sendmail -> /usr/bin/cronlog

Crontabs:

cron.log:
-rw-r--r--+ 1 _PSCGRM.ABInitioTst Domain Users 0 Aug 26 08:09 /var/log/cron.log

cron.pid:

Crontab:

Windows Application Events log:

Cygcheck:

Cygwin Configuration Diagnostics
Current System Time: Wed Aug 26 08:28:13 2020

Windows 2012 R2 Server Standard Ver 6.3 Build 9600 

Running in Terminal Service session

Path:   D:\apps\Java\jre1.7.0_45\bin
C:\Program Files\Python\Scripts
C:\Program Files\Python
D
D:\apps\cygwin\apps\abinitio\AbInitio-V3-1-7-0\bin
D:\apps\cygwin\bin
C:\Program Files\Python\Scripts
C:\Program Files\Python
C:\Windows
C:\Windows\System32
C:\Program Files\Java\jre7\bin
D:\apps\abinitio\AbInitio-V3-1-7-0\bin
C:\IBM\ITM\bin
C:\IBM\ITM\TMAITM6
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn
C:\Program Files\Microsoft SQL Server\110\Tools\Binn
C:\Program Files\Microsoft SQL Server\110\DTS\Binn
C:\Program Files (x86)\Microsoft SQL Server\Client 
SDK\ODBC\130\Tools\Binn
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn
C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn
C:\Program Files (x86)\Microsoft SQL 
Server\140\Tools\Binn\ManagementStudio
C:\IBM\ITM\InstallITM
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
D:\apps\cygwin\bin

Output from D:\apps\cygwin\bin\id.exe
UID: 33874(_PSCGRM.ABInitioTst) GID: 10513(Domain Users)
10513(Domain Users) 544(Administrators)
559(Performance Log Users)  545(Users)
33871(APP-ABInitioTest-gs)

SysDir: C:\Windows\system32
WinDir: C:\Windows

USER = '_PSCGRM.ABInitioTst'
PWD = '/home/_PSCGRM.ABInitioTst'
CYGWIN = 'ntsec'
HOME = '/home/_PSCGRM.ABInitioTst'

USERDOMAIN_ROAMINGPROFILE = 'DEVINT'
HOMEPATH = '\Users\_PSCGRM.ABInitioTst'
MANPATH = '/usr/share/man:/usr/man::/usr/ssl/man'
APPDATA = 'C:\Users\_PSCGRM.ABInitioTst\AppData\Roaming'
ProgramW6432 = 'C:\Program Files'
HOSTNAME = 'pscappt00135'
AB_AG_CONFIG_DIR = 'd:/apps/abinitio/ab-deployments/ag_test/

Re: How to start and verify cron?

2019-07-13 Thread Brian Inglis


On 2019-07-12 10:18, David Karr wrote:
> On Fri, Jul 12, 2019 at 8:20 AM Brian Inglis wrote:
>> On 2019-07-11 15:20, David Karr wrote:
>>> On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
>>> On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
>>> On 2019-07-10 16:15, David Karr wrote:
>>> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>>> > On 2019-07-10 10:55, David Karr wrote:
>>> > > I've checked the user guide and the FAQ, and I can't find 
>>> any
>>> information
>>> > > about how to start cron and verify that it's working.  I 
>>> found
>>> other blog
>>> > > posts on other sites, but some of them are old.
>>>     >
>>> > Did you run service setup script /bin/cron-config to set up 
>>> the
>>> service?
>>> > When I ran that now, it says "Cron is already installed as a 
>>> service under
>>> > account ...", so I assume that means that I did.
>>> > > I had installed cron, and I thought it was working, but now 
>>> I
>>> think that it
>>> > > is not.  If I edit "~/crontab" and then run "crontab -l", it
>>> lists the
>>> > > changes I've made to jobs, so at least that is working.  The
>>> real job I
>>> > > have didn't appear to be doing what it was supposed to be 
>>> doing,
>>> so I added
>>> > > a new trivial job that just appends output from "date" to a 
>>> file
>>> in my
>>> > > homedir, and after the scheduled time of the job, the file 
>>> was
>>> not created.
>>> >
>>> > Messages from cron and other active services should be 
>>> visible in
>>> the Windows
>>> > application event log if you have not set up a syslog service.
>>> > I went through it, but I didn't see any indications of issues with
>>>     cron.  I'm
>>> > not sure what to look for, or where in the event log interface.
>>> > > This is the additional job I added:
>>> > >
>>> > > 40,42,44 * * * * date >> /home//date.txt
>>> > >
>>> > > I did find a "/var/log/cron.log", but it is empty, and the
>>> modtime is from
>>> > > a few months ago.
>>> > >
>>> > > One blog post I found talks about running "cygrunsrv -I 
>>> cron -p
>>> > > /usr/sbin/cron -a -D". I just did this, and it reports "The
>>> specified
>>> > > service already exists."
>>> > >
>>> > > This is my uname -a output:
>>> > >
>>> > > CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 
>>> x86_64 Cygwi
>>> > For a more Unix like and self contained Cygwin approach, 
>>> install
>>> syslog-ng, run
>>> > service setup scripts /bin/cygserver-config 
>>> /bin/syslog-ng-config
>>> > /bin/cron-config, add service dependencies to start up in that
>>> order, and you
>>> > should see cron messages in /var/log/syslog if you run 
>>> elevated:
>>> you can also
>>> > run chmod elevated to make /var/log/syslog world readable, or
>>> setfacl to add
>>> > user or group read ACLs.
>>> > How do I add service dependencies to start up in a particular 
>>> order?
>>> In an elevated cmd or bash shell:
>>> elevated > OR # sc config syslog-ng depend= cygserver
>>> elevated > OR # sc config cron depend= syslog-ng/cygserver
>>> N.B. the "=" is part of each keyword; multiple service dependencies 
>>> are
>>> separated by "/".
>>> It's curious that when I bring up the default "Packages" view, 
>>> filtering for
>>> "syslog-ng" doesn'

Re: How to start and verify cron?

2019-07-13 Thread Brian Inglis


On 2019-07-13 01:59, Henning wrote:
> On 12/07/2019 17:20, Brian Inglis wrote:
>> Do not forget to *ALWAYS* shut down all Cygwin services before running
>> setup to upgrade any Cygwin packages.
> Does this mean to also shut down cygserver before running setup?

Yes - it's linked to cygwin1.dll.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-13 Thread Henning

On 12/07/2019 17:20, Brian Inglis wrote:

Do not forget to *ALWAYS* shut down all Cygwin services before running setup to
upgrade any Cygwin packages.


Does this mean to also shut down cygserver before running setup?

Henning



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-12 Thread David Karr
On Fri, Jul 12, 2019 at 8:20 AM Brian Inglis wrote:
>
> On 2019-07-11 15:20, David Karr wrote:
> > On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
> > On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
> > On 2019-07-10 16:15, David Karr wrote:
> > > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> > > On 2019-07-10 10:55, David Karr wrote:
> > > > I've checked the user guide and the FAQ, and I can't find 
> > any
> > information
> > > > about how to start cron and verify that it's working.  I 
> > found
> > other blog
> > > > posts on other sites, but some of them are old.
> > >
> > > Did you run service setup script /bin/cron-config to set up 
> > the
> > service?
> > > When I ran that now, it says "Cron is already installed as a 
> > service under
> > > account ...", so I assume that means that I did.
> > > > I had installed cron, and I thought it was working, but now 
> > I
> > think that it
> > > > is not.  If I edit "~/crontab" and then run "crontab -l", it
> > lists the
> > > > changes I've made to jobs, so at least that is working.  The
> > real job I
> > > > have didn't appear to be doing what it was supposed to be 
> > doing,
> > so I added
> > > > a new trivial job that just appends output from "date" to a 
> > file
> > in my
> > > > homedir, and after the scheduled time of the job, the file 
> > was
> > not created.
> > >
> > > Messages from cron and other active services should be 
> > visible in
> > the Windows
> > > application event log if you have not set up a syslog service.
> > > I went through it, but I didn't see any indications of issues with
> > cron.  I'm
> > > not sure what to look for, or where in the event log interface.
> > > > This is the additional job I added:
> > > >
> > > > 40,42,44 * * * * date >> /home//date.txt
> > > >
> > > > I did find a "/var/log/cron.log", but it is empty, and the
> > modtime is from
> > > > a few months ago.
> > > >
> > > > One blog post I found talks about running "cygrunsrv -I 
> > cron -p
> > > > /usr/sbin/cron -a -D". I just did this, and it reports "The
> > specified
> > > > service already exists."
> > > >
> > > > This is my uname -a output:
> > > >
> > > > CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 
> > x86_64 Cygwi
> > > For a more Unix like and self contained Cygwin approach, 
> > install
> > syslog-ng, run
> > > service setup scripts /bin/cygserver-config 
> > /bin/syslog-ng-config
> > > /bin/cron-config, add service dependencies to start up in that
> > order, and you
> > > should see cron messages in /var/log/syslog if you run 
> > elevated:
> > you can also
> > > run chmod elevated to make /var/log/syslog world readable, or
> > setfacl to add
> > > user or group read ACLs.
> > > How do I add service dependencies to start up in a particular 
> > order?
> > In an elevated cmd or bash shell:
> > elevated > OR # sc config syslog-ng depend= cygserver
> > elevated > OR # sc config cron depend= syslog-ng/cygserver
> > N.B. the "=" is part of each keyword; multiple service dependencies 
> > are
> > separated by "/".
> > It's curious that when I bring up the default "Packages" view, 
> > filtering for
> > "syslog-ng" doesn't find anything.  I had to switch to the Categories 
> > view,
> > and then filtering for that found it.
> > After doing all of this, I still can't get cron jobs to work, and I can't 
> > get
> > any info on why.
> > This is the current output from &

Re: How to start and verify cron?

2019-07-12 Thread Brian Inglis
On 2019-07-11 15:20, David Karr wrote:
> On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
> On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
> On 2019-07-10 16:15, David Karr wrote:
> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> >     On 2019-07-10 10:55, David Karr wrote:
> >     > I've checked the user guide and the FAQ, and I can't find any
> information
> >     > about how to start cron and verify that it's working.  I found
> other blog
> >     > posts on other sites, but some of them are old.
> >
> >     Did you run service setup script /bin/cron-config to set up the
> service?
> > When I ran that now, it says "Cron is already installed as a 
> service under
> > account ...", so I assume that means that I did.
> >     > I had installed cron, and I thought it was working, but now I
> think that it
> >     > is not.  If I edit "~/crontab" and then run "crontab -l", it
> lists the
> >     > changes I've made to jobs, so at least that is working.  The
> real job I
> >     > have didn't appear to be doing what it was supposed to be 
> doing,
> so I added
> >     > a new trivial job that just appends output from "date" to a 
> file
> in my
> >     > homedir, and after the scheduled time of the job, the file was
> not created.
> >
> >     Messages from cron and other active services should be visible 
> in
> the Windows
> >     application event log if you have not set up a syslog service.
> > I went through it, but I didn't see any indications of issues with
> cron.  I'm
> > not sure what to look for, or where in the event log interface.
> >     > This is the additional job I added:
> >     >
> >     >     40,42,44 * * * * date >> /home//date.txt
> >     >
> >     > I did find a "/var/log/cron.log", but it is empty, and the
> modtime is from
> >     > a few months ago.
> >     >
> >     > One blog post I found talks about running "cygrunsrv -I cron 
> -p
> >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
> specified
> >     > service already exists."
> >     >
> >     > This is my uname -a output:
> >     >
> >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 
> x86_64 Cygwi
> >     For a more Unix like and self contained Cygwin approach, install
> syslog-ng, run
> >     service setup scripts /bin/cygserver-config 
> /bin/syslog-ng-config
> >     /bin/cron-config, add service dependencies to start up in that
> order, and you
> >     should see cron messages in /var/log/syslog if you run elevated:
> you can also
> >     run chmod elevated to make /var/log/syslog world readable, or
> setfacl to add
> >     user or group read ACLs.
> > How do I add service dependencies to start up in a particular order?
> In an elevated cmd or bash shell:
> elevated > OR # sc config syslog-ng depend= cygserver
> elevated > OR # sc config cron depend= syslog-ng/cygserver
> N.B. the "=" is part of each keyword; multiple service dependencies 
> are
> separated by "/".
> It's curious that when I bring up the default "Packages" view, filtering 
> for
> "syslog-ng" doesn't find anything.  I had to switch to the Categories 
> view,
> and then filtering for that found it.
> After doing all of this, I still can't get cron jobs to work, and I can't get
> any info on why.
> This is the current output from "crontab -l":
> 0       0,12    *       *       *       find /tmp/.logcache/ -type f -mtime +6
> -exec rm {} \;
> 14,15,16,17     *       *       *       *        date >> /home/dk068x/date.txt
> I've tried editing that last one and changing the minutes to include upcoming
> minutes, and then after those minutes, I check the results, and there are 
> none. 
> Nothing in cron.log or syslog-ng.log.

Did you run the -config scripts to setup the services?
Did you restart all services after any changes?

# for srv in cy

Re: How to start and verify cron?

2019-07-11 Thread René Berber
On 7/11/2019 5:57 PM, René Berber wrote:

> parameter in the installation as service ("-L 1" in the cygrunsrv line

Sorry this is not clear.

I should have writen something like 'cygrunsrv -I ... -a "-L 1" ...'
-- 
R.Berber


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread René Berber
On 7/11/2019 4:20 PM, David Karr wrote:

>>>> How do I add service dependencies to start up in a particular order?
>>>
>>> In an elevated cmd or bash shell:
>>> elevated > OR # sc config syslog-ng depend= cygserver
>>> elevated > OR # sc config cron depend= syslog-ng/cygserver
>>> N.B. the "=" is part of each keyword; multiple service dependencies are
>>> separated by "/".
>>
> After doing all of this, I still can't get cron jobs to work, and I can't
> get any info on why.

Doing all of "that" doesn't change a running cron daemon; those only
afect the initial run after boot up.

> This is the current output from "crontab -l":
...
> I've tried editing that last one and changing the minutes to include
> upcoming minutes, and then after those minutes, I check the results, and
> there are none.  Nothing in cron.log or syslog-ng.log.

Editing in this context means running 'crontab -e' (which uses vi to
edit the user's cron table).  After exiting that (with ZZ to save &
exit, or :wq) cron sends a message to the log, which, by the way may
need to be configured (i.e. syslog-ng has its own configuration, an in
there may be a line that says where cron's log goes, or if it is ignored).

Restarting the daemon should also produce a line in the log, which is
another notification that it is working.

In Linux I even have set the cron daemon's log level to show the start
of all cron jobs; that parameter in Cygwin would go as optional
parameter in the installation as service ("-L 1" in the cygrunsrv line
of the installation script, or maybe running cygrunsrv again, visible
and editable in the "Start parameters" at the service Properties view).
-- 
R.Berber



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread Vince Rice
> On Jul 11, 2019, at 4:18 PM, David Karr wrote:
> 
> I typically try to avoid top-posting, but I'm pretty sure I won't be able
> to do anything about the mailer configuration.

Then you'll need to fix it manually, like I just did on yours. Whichever it is, 
please
stop including email addresses in your replies.
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread David Karr
On Thu, Jul 11, 2019 at 12:56 PM David Karr 
wrote:

> It's curious that when I bring up the default "Packages" view, filtering
> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
> view, and then filtering for that found it.
>
> On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis <
> brian.ing...@systematicsw.ab.ca> wrote:
>
>> On 2019-07-10 16:15, David Karr wrote:
>> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>> > On 2019-07-10 10:55, David Karr wrote:
>> > > I've checked the user guide and the FAQ, and I can't find any
>> information
>> > > about how to start cron and verify that it's working.  I found
>> other blog
>> > > posts on other sites, but some of them are old.
>> >
>> > Did you run service setup script /bin/cron-config to set up the
>> service?
>> > When I ran that now, it says "Cron is already installed as a service
>> under
>> > account ...", so I assume that means that I did.
>> > > I had installed cron, and I thought it was working, but now I
>> think that it
>> > > is not.  If I edit "~/crontab" and then run "crontab -l", it
>> lists the
>> > > changes I've made to jobs, so at least that is working.  The real
>> job I
>> >     > have didn't appear to be doing what it was supposed to be doing,
>> so I added
>> > > a new trivial job that just appends output from "date" to a file
>> in my
>> > > homedir, and after the scheduled time of the job, the file was
>> not created.
>> >
>> > Messages from cron and other active services should be visible in
>> the Windows
>> > application event log if you have not set up a syslog service.
>> > I went through it, but I didn't see any indications of issues with
>> cron.  I'm
>> > not sure what to look for, or where in the event log interface.
>> > > This is the additional job I added:
>> > >
>> > > 40,42,44 * * * * date >> /home//date.txt
>> > >
>> > > I did find a "/var/log/cron.log", but it is empty, and the
>> modtime is from
>> > > a few months ago.
>> > >
>> > > One blog post I found talks about running "cygrunsrv -I cron -p
>> > > /usr/sbin/cron -a -D". I just did this, and it reports "The
>> specified
>> > > service already exists."
>> > >
>> > > This is my uname -a output:
>> > >
>> > > CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64
>> Cygwi
>> > For a more Unix like and self contained Cygwin approach, install
>> syslog-ng, run
>> > service setup scripts /bin/cygserver-config /bin/syslog-ng-config
>> > /bin/cron-config, add service dependencies to start up in that
>> order, and you
>> > should see cron messages in /var/log/syslog if you run elevated:
>> you can also
>> > run chmod elevated to make /var/log/syslog world readable, or
>> setfacl to add
>> > user or group read ACLs.
>> > How do I add service dependencies to start up in a particular order?
>>
>> In an elevated cmd or bash shell:
>> elevated > OR # sc config syslog-ng depend= cygserver
>> elevated > OR # sc config cron depend= syslog-ng/cygserver
>> N.B. the "=" is part of each keyword; multiple service dependencies are
>> separated by "/".
>>
>
After doing all of this, I still can't get cron jobs to work, and I can't
get any info on why.

This is the current output from "crontab -l":


# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (crontab installed on Thu Jul 11 14:13:09 2019)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp
$)
0   0,12*   *   *   find /tmp/.logcache/ -type f -mtime
+6 -exec rm {} \;
14,15,16,17 *   *   *   *date >>
/home/dk068x/date.txt


I've tried editing that last one and changing the minutes to include
upcoming minutes, and then after those minutes, I check the results, and
there are none.  Nothing in cron.log or syslog-ng.log.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread David Karr
On Thu, Jul 11, 2019 at 1:23 PM Vince Rice 
wrote:

> > On Jul 11, 2019, at 3:12 PM, Vince Rice wrote:
> >
> >> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
> >>
> >> It's curious that when I bring up the default "Packages" view, filtering
> >> for "syslog-ng" doesn't find anything.  I had to switch to the
> Categories
> >> view, and then filtering for that found it.
> >
> > Not that curious. Setup's search is searching packages contained within
> > the current view. "Packages" is not one of the drop-down options for
> View.
> > The default view is, I believe, Pending, or at least that's what always
> opens
> > for me. And it wouldn't show up in Pending for you since it's not
> installed on
> > your PC and therefore can't be pending. Categories (and Full) both show
> all
> > packages, and therefore it would be found in those views.
> >
> > Also, please don't top post. https://cygwin.com/acronyms/#TOFU
>
> And https://cygwin.com/acronyms/#PCYMTNQREAIYR. (Sorry, missed that
> the first time.)
>

I typically try to avoid top-posting, but I'm pretty sure I won't be able
to do anything about the mailer configuration.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread Vince Rice
> On Jul 11, 2019, at 3:12 PM, Vince Rice wrote:
> 
>> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
>> 
>> It's curious that when I bring up the default "Packages" view, filtering
>> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
>> view, and then filtering for that found it.
> 
> Not that curious. Setup's search is searching packages contained within
> the current view. "Packages" is not one of the drop-down options for View.
> The default view is, I believe, Pending, or at least that's what always opens 
> for me. And it wouldn't show up in Pending for you since it's not installed on
> your PC and therefore can't be pending. Categories (and Full) both show all
> packages, and therefore it would be found in those views.
> 
> Also, please don't top post. https://cygwin.com/acronyms/#TOFU

And https://cygwin.com/acronyms/#PCYMTNQREAIYR. (Sorry, missed that
the first time.)
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread Vince Rice
> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
> 
> It's curious that when I bring up the default "Packages" view, filtering
> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
> view, and then filtering for that found it.

Not that curious. Setup's search is searching packages contained within
the current view. "Packages" is not one of the drop-down options for View.
The default view is, I believe, Pending, or at least that's what always opens 
for me. And it wouldn't show up in Pending for you since it's not installed on
your PC and therefore can't be pending. Categories (and Full) both show all
packages, and therefore it would be found in those views.

Also, please don't top post. https://cygwin.com/acronyms/#TOFU
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-11 Thread David Karr
It's curious that when I bring up the default "Packages" view, filtering
for "syslog-ng" doesn't find anything.  I had to switch to the Categories
view, and then filtering for that found it.

On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis <
brian.ing...@systematicsw.ab.ca> wrote:

> On 2019-07-10 16:15, David Karr wrote:
> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> > On 2019-07-10 10:55, David Karr wrote:
> > > I've checked the user guide and the FAQ, and I can't find any
> information
> > > about how to start cron and verify that it's working.  I found
> other blog
> > > posts on other sites, but some of them are old.
> >
> >     Did you run service setup script /bin/cron-config to set up the
> service?
> > When I ran that now, it says "Cron is already installed as a service
> under
> > account ...", so I assume that means that I did.
> > > I had installed cron, and I thought it was working, but now I
> think that it
> > > is not.  If I edit "~/crontab" and then run "crontab -l", it lists
> the
> > > changes I've made to jobs, so at least that is working.  The real
> job I
> > > have didn't appear to be doing what it was supposed to be doing,
> so I added
> > > a new trivial job that just appends output from "date" to a file
> in my
> > > homedir, and after the scheduled time of the job, the file was not
> created.
> >
> > Messages from cron and other active services should be visible in
> the Windows
> > application event log if you have not set up a syslog service.
> > I went through it, but I didn't see any indications of issues with
> cron.  I'm
> > not sure what to look for, or where in the event log interface.
> > > This is the additional job I added:
> > >
> > > 40,42,44 * * * * date >> /home//date.txt
> > >
> > > I did find a "/var/log/cron.log", but it is empty, and the modtime
> is from
> > > a few months ago.
> > >
> > > One blog post I found talks about running "cygrunsrv -I cron -p
> > > /usr/sbin/cron -a -D". I just did this, and it reports "The
> specified
> > > service already exists."
> > >
> > > This is my uname -a output:
> > >
> > > CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64
> Cygwi
> > For a more Unix like and self contained Cygwin approach, install
> syslog-ng, run
> > service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> >     /bin/cron-config, add service dependencies to start up in that
> order, and you
> > should see cron messages in /var/log/syslog if you run elevated: you
> can also
> > run chmod elevated to make /var/log/syslog world readable, or
> setfacl to add
> > user or group read ACLs.
> > How do I add service dependencies to start up in a particular order?
>
> In an elevated cmd or bash shell:
> elevated > OR # sc config syslog-ng depend= cygserver
> elevated > OR # sc config cron depend= syslog-ng/cygserver
> N.B. the "=" is part of each keyword; multiple service dependencies are
> separated by "/".
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-10 Thread Brian Inglis
On 2019-07-10 16:15, David Karr wrote:
> On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> On 2019-07-10 10:55, David Karr wrote:
> > I've checked the user guide and the FAQ, and I can't find any 
> information
>     > about how to start cron and verify that it's working.  I found other 
> blog
> > posts on other sites, but some of them are old.
> 
> Did you run service setup script /bin/cron-config to set up the service?
> When I ran that now, it says "Cron is already installed as a service under
> account ...", so I assume that means that I did.
> > I had installed cron, and I thought it was working, but now I think 
> that it
> > is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
> > changes I've made to jobs, so at least that is working.  The real job I
> > have didn't appear to be doing what it was supposed to be doing, so I 
> added
> > a new trivial job that just appends output from "date" to a file in my
> > homedir, and after the scheduled time of the job, the file was not 
> created.
> 
> Messages from cron and other active services should be visible in the 
> Windows
> application event log if you have not set up a syslog service.
> I went through it, but I didn't see any indications of issues with cron.  I'm
> not sure what to look for, or where in the event log interface.
> > This is the additional job I added:
> >
> >     40,42,44 * * * * date >> /home//date.txt
> >
> > I did find a "/var/log/cron.log", but it is empty, and the modtime is 
> from
> > a few months ago.
> >
> > One blog post I found talks about running "cygrunsrv -I cron -p
> > /usr/sbin/cron -a -D". I just did this, and it reports "The specified
> > service already exists."
> >
> > This is my uname -a output:
> >
> >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
> For a more Unix like and self contained Cygwin approach, install 
> syslog-ng, run
> service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> /bin/cron-config, add service dependencies to start up in that order, and 
> you
> should see cron messages in /var/log/syslog if you run elevated: you can 
> also
> run chmod elevated to make /var/log/syslog world readable, or setfacl to 
> add
> user or group read ACLs.
> How do I add service dependencies to start up in a particular order?

In an elevated cmd or bash shell:
elevated > OR # sc config syslog-ng depend= cygserver
elevated > OR # sc config cron depend= syslog-ng/cygserver
N.B. the "=" is part of each keyword; multiple service dependencies are
separated by "/".

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-10 Thread David Karr
On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis <
brian.ing...@systematicsw.ab.ca> wrote:

> On 2019-07-10 10:55, David Karr wrote:
> > I've checked the user guide and the FAQ, and I can't find any information
> > about how to start cron and verify that it's working.  I found other blog
> > posts on other sites, but some of them are old.
>
> Did you run service setup script /bin/cron-config to set up the service?
>

When I ran that now, it says "Cron is already installed as a service under
account ...", so I assume that means that I did.


> > I had installed cron, and I thought it was working, but now I think that
> it
> > is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
> > changes I've made to jobs, so at least that is working.  The real job I
> > have didn't appear to be doing what it was supposed to be doing, so I
> added
> > a new trivial job that just appends output from "date" to a file in my
> > homedir, and after the scheduled time of the job, the file was not
> created.
>
> Messages from cron and other active services should be visible in the
> Windows
> application event log if you have not set up a syslog service.
>

I went through it, but I didn't see any indications of issues with cron.
I'm not sure what to look for, or where in the event log interface.


> > This is the additional job I added:
> >
> > 40,42,44 * * * * date >> /home//date.txt
> >
> > I did find a "/var/log/cron.log", but it is empty, and the modtime is
> from
> > a few months ago.
> >
> > One blog post I found talks about running "cygrunsrv -I cron -p
> > /usr/sbin/cron -a -D". I just did this, and it reports "The specified
> > service already exists."
> >
> > This is my uname -a output:
> >
> > CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
> For a more Unix like and self contained Cygwin approach, install
> syslog-ng, run
> service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> /bin/cron-config, add service dependencies to start up in that order, and
> you
> should see cron messages in /var/log/syslog if you run elevated: you can
> also
> run chmod elevated to make /var/log/syslog world readable, or setfacl to
> add
> user or group read ACLs.
>

How do I add service dependencies to start up in a particular order?


> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to start and verify cron?

2019-07-10 Thread Brian Inglis
On 2019-07-10 10:55, David Karr wrote:
> I've checked the user guide and the FAQ, and I can't find any information
> about how to start cron and verify that it's working.  I found other blog
> posts on other sites, but some of them are old.

Did you run service setup script /bin/cron-config to set up the service?

> I had installed cron, and I thought it was working, but now I think that it
> is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
> changes I've made to jobs, so at least that is working.  The real job I
> have didn't appear to be doing what it was supposed to be doing, so I added
> a new trivial job that just appends output from "date" to a file in my
> homedir, and after the scheduled time of the job, the file was not created.

Messages from cron and other active services should be visible in the Windows
application event log if you have not set up a syslog service.

> This is the additional job I added:
> 
> 40,42,44 * * * * date >> /home//date.txt
> 
> I did find a "/var/log/cron.log", but it is empty, and the modtime is from
> a few months ago.
> 
> One blog post I found talks about running "cygrunsrv -I cron -p
> /usr/sbin/cron -a -D". I just did this, and it reports "The specified
> service already exists."
> 
> This is my uname -a output:
> 
> CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
For a more Unix like and self contained Cygwin approach, install syslog-ng, run
service setup scripts /bin/cygserver-config /bin/syslog-ng-config
/bin/cron-config, add service dependencies to start up in that order, and you
should see cron messages in /var/log/syslog if you run elevated: you can also
run chmod elevated to make /var/log/syslog world readable, or setfacl to add
user or group read ACLs.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



How to start and verify cron?

2019-07-10 Thread David Karr
I've checked the user guide and the FAQ, and I can't find any information
about how to start cron and verify that it's working.  I found other blog
posts on other sites, but some of them are old.

I had installed cron, and I thought it was working, but now I think that it
is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
changes I've made to jobs, so at least that is working.  The real job I
have didn't appear to be doing what it was supposed to be doing, so I added
a new trivial job that just appends output from "date" to a file in my
homedir, and after the scheduled time of the job, the file was not created.

This is the additional job I added:

40,42,44 * * * * date >> /home//date.txt

I did find a "/var/log/cron.log", but it is empty, and the modtime is from
a few months ago.

One blog post I found talks about running "cygrunsrv -I cron -p
/usr/sbin/cron -a -D". I just did this, and it reports "The specified
service already exists."

This is my uname -a output:

CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwin

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cron running but not executing user crontab

2018-01-15 Thread René Berber
On 1/15/2018 2:48 PM, Chris Johnson wrote:

> Bit of a conundrum here.  Running WIN7 and cygwin64.  Have the terminal
> running and Perl is installed and runs.  AFAIK, that all works.  Used
> cygrunsrv to get cron going.

Not sure if I remember this right, but there is a cron-config in the
package, and that is what you are supposed to use to install it as a
service (and set a proper daemon user, file & dir access, etc.)  You
probably will have to undo whatever you did with cygrunsrv.

Better read /usr/share/doc/Cygwin/cron-4.1-65.README to be sure.

Hope this helps.
-- 
R. Berber


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cron running but not executing user crontab

2018-01-15 Thread Brian Inglis
On 2018-01-15 13:48, Chris Johnson wrote:
> Bit of a conundrum here.  Running WIN7 and cygwin64.  Have the terminal 
> running
> and Perl is installed and runs.  AFAIK, that all works.  Used cygrunsrv to get
> cron going.  I can see cron in a ps -af in the terminal.  I set up a crontab 
> for
> my user and it's in /var/cron/tabs by using crontab -e.
> 
> Doesn't seem to be running anything in the crontab.  I had wanted to run a 
> Perl
> script in a Windows Directory outside the cygwin structure but using the
> /cygdrive/c etc path.  Ain't working.  Even tried the simplest thing I could
> think of and created a line date > dt.txt on it.  Normally, under *nix this 
> would put the results of date in dt.txt in the home directory.  Not there.

Use /proc/cygdrive/c/... in case it ever changes, and specify absolute paths for
scripts and commands, as only minimal environments are setup, and
non-interactive shell startup scripts run.
Might need to specify other environment variables required in the crontab.
Ensure your perl script has Cygwin +x permissions and hashbang line.

> Just isn't running anything as far as I can tell.
> 
> Any suggestions.  I'd like to get this working.  Want am I missing? Help 
> appreciated.  Thank you

Add cron users to /var/cron/cron.allow (and maybe also a cron group), or touch
/var/cron/cron.deny to allow all users: see crontab(1).
Check /etc/crontab and /etc/cron.d/* are owned and writable only by the crond
user if they exist; /var/run/cron.pid and /var/log/cron.log exist and are owned
and writable only by the crond user; /var/cron/tabs/* exist and are owned by
their users and writable only by their owners; /var/run/cron.pid contains the
cron pid, and see what's in /var/log/cron.log.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



cron running but not executing user crontab

2018-01-15 Thread Chris Johnson
Bit of a conundrum here.  Running WIN7 and cygwin64.  Have the terminal 
running and Perl is installed and runs.  AFAIK, that all works.  Used 
cygrunsrv to get cron going.  I can see cron in a ps -af in the 
terminal.  I set up a crontab for my user and it's in /var/cron/tabs by 
using crontab -e.


Doesn't seem to be running anything in the crontab.  I had wanted to run 
a Perl script in a Windows Directory outside the cygwin structure but 
using the /cygdrive/c etc path.  Ain't working.  Even tried the simplest 
thing I could think of and created a line date > dt.txt on it.  
Normally, under *nix this  would put the results of date in dt.txt in 
the home directory.  Not there.


Just isn't running anything as far as I can tell.

Any suggestions.  I'd like to get this working.  Want am I missing? 
Help  appreciated.  Thank you



--

Chris Johnson   rchristopherjohn...@gmail.com
Ex SysAdmin, now, writer/The hardest thing in this world is to live in 
it.
/(Buffy, the vampire slayer EOS 5)


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Vixie's cron and cron-config broken? /etc/passwd empty - Entry for the SYSTEM sid was not found in passwd. Unknown system name

2017-12-12 Thread OwN-3m-All
Anyone?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Vixie's cron and cron-config broken? /etc/passwd empty - Entry for the SYSTEM sid was not found in passwd. Unknown system name

2017-12-05 Thread OwN-3m-All
Is the current version of cron and cron-config broken?  I tried
installing cron (4.1-65) with the latest version of cygwin in Windows
10 x64 Pro

When I run the following bash script to attempt to configure cron:

cron-config << EOF
yes
ntsec
no
no
no
adminpass
adminpass
yes
EOF

I get the following output:

Entry for the SYSTEM sid was not found in passwd.
Unknown system name

So, to work around this, I generated the /etc/passwd file since it is
no longer generated by default using:

mkpasswd > /etc/passwd

Then, if I try to execute cron-config again, I still get the same output:

Entry for the SYSTEM sid was not found in passwd.
Unknown system name

The cygserver service was installed and is running just fine.  Anyone
know how to get this to work?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: cron bug

2016-01-13 Thread Chuck Roberts
> Hello,
>
> I have set up cron as below on a fresh Windows 10 with a fresh,
> minimal 64-bit Cygwin installation. Cronjobs are not executed and
cronevents says /usr/sbin/cron:
> PID 608: (CRON) error (can't switch user context). The output of
> cronbug
is attached.

>
> When I run the service not under my own user but as an administrator,
> the result and error is the same.

First I try not to make any assumptions about what the user knows about
cron. So here are some tips.

- In general, do not edit the system crontab files, instead edit your user
crontab files with 'crontab -e' where '-e' means edit. You will need an
environment variable to setup an editor like this: 'export EDITOR=nedit'.
You can put the whole path to nedit in there if need be.

So, what is the exact command you are using to edit the crontab files?

- When the cron job runs it runs in it's own shell, with no environment
variables at all, i.e. no PATH or anything. To set environment variables
add these entries to the crontab file:

PATH=/usr/bin:/sbin:/whatever
MAIL=youruser (sends email to this account)

Each time cron runs and produces output, an email is sent to the account
in the MAIL variable.

- Next, the command must include the full path to the command like this:
1 18 29 1 * /home/comp/perl/me/gocron

If gocron is a bash script which calls a Perl program, I always pass the
working directory to my Perl program inside the 'gocron' bash script. I
think I had trouble getting the current directory inside my Perl script
with $t=`pwd`;. It would work during testing outside of cron, but when it
was run by cron, pwd didn't work. I also test my bash scripts with the
'at' command, which works very much like cron, but with less typing.

The at format is: at -f FILETORUN TIMESPEC
Example: at -f /path/to/file/gocron now (run now)
Example: at -f /path/to/file/gocron + 1 minute (run 1 minute from now)
Example: at -f /path/to/file/gocron 2:05pm (runs at 2:05pm based on the
server time)


This runs my gocron bash script after 1 minute passes. See the man page
for 'at' for more info on the TIMESPEC format.



Chuck

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: cron bug

2016-01-13 Thread Pierre A Humblet
> -Original Message-
> From:  Stefan Götz
> Sent: Wednesday, January 13, 2016 12:55 AM
> 
> 
> Hello,
> 
> I have set up cron as below on a fresh Windows 10 with a fresh,
> minimal 64-bit Cygwin installation. Cronjobs are not executed and
cronevents says /usr/sbin/cron:
> PID 608: (CRON) error (can't switch user context). The output of cronbug
is attached.

> 
> When I run the service not under my own user but as an administrator, the
> result and error is the same.
> 
> 
> Thanks! Any advice is appreciated.
> 
> 
> $ cron-config

Thanks for sending the cronbug.txt, Stefan.

It shows that although you asked to run as yourself the daemon is actually
running under the SYSTEM account.
That explains the error message, but I wonder why cron-config misbehaves.
That hasn't changed in years.
Are you logged in with your "Windows id" (instead of as your local user id)?

If so there has been a similar case that has never been fully explained.

Could you do the following:
Edit /bin/cron-config and uncomment the second line (set -x)
Run the modified cron-config, reproducing exactly what you do usually
(remove the service, ask to run as yourself).
The details of what the script does will be echoed.
Then paste the whole output in an e-mail, you can send it to me privately.

Pierre


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



cron bug

2016-01-12 Thread Stefan Götz
Hello,

I’ve set up cron as below on a fresh Windows 10 with a fresh, minimal 64-bit 
Cygwin installation. Cronjobs are not executed and cronevents says 
/usr/sbin/cron:
PID 608: (CRON) error (can't switch user context). The output of cronbug is 
attached.

 

When I run the service not under my own user but as an administrator, the 
result and error is the same.

 

Thanks! Any advice is appreciated.

 

 

$ cron-config

The cron daemon can run as a service or as a job. The latter is not recommended.

Cron is already installed as a service under account LocalSystem.

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: [ ] CYGWIN

 

You must decide under what account the cron daemon will run.

If you are the only user on this machine, the daemon can run as yourself.

   This gives access to all network drives but only allows you as user.

To run multiple users, cron must change user context without knowing

  the passwords. There are three methods to do that, as explained in

  http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1

If all the cron users have executed "passwd -R" (see man passwd),

  which provides access to network drives, or if you are using the

  cyglsa package, then cron should run under the local system account.

Otherwise you need to have or to create a privileged account.

  This script will help you do so.

Do you want the cron daemon to run as yourself? (yes/no) yes

 

Running cron_diagnose ...

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

 

WARNING: PATH may be set differently under cron than in interactive shells.

 Names such as "find" and "date" may refer to Windows programs.


Current version

Running crons:
 223622922236   4308  ? 18 15:40:35 /usr/sbin/cron

Sendmail:
lrwxrwxrwx 1 Caro None 16 Jan 12 12:30 /usr/sbin/sendmail -> /usr/bin/cronlog

Crontabs:
-rw-r- 1 Caro Administrators 252 Jan 13 12:09 /var/cron/tabs/Caro
-rw-r----- 1 197609 544 252 Jan 13 12:09 /var/cron/tabs/Caro

cron.log:
-rwr-- 1 SYSTEM SYSTEM 0 Jan 13 15:40 /var/log/cron.log

cron.pid:
-rwr-- 1 SYSTEM SYSTEM 5 Jan 13 15:40 /var/run/cron.pid

Crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.6AIxFKqPoy installed on Wed Jan 13 12:09:45 2016)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
* * * * * /usr/bin/touch /home/Caro/crontimestamp

Windows Application Events log:
2016/01/12 12:34:22 [SYSTEM] /usr/sbin/cron: PID 3044: (CRON) STARTUP (V5.0)
2016/01/12 12:34:23 [SYSTEM] cron: PID 8712: `cron' service started
2016/01/12 12:34:49 [Caro] crontab: PID 9196: (Caro) BEGIN EDIT (Caro)
2016/01/12 12:34:55 [Caro] crontab: PID 9196: (Caro) END EDIT (Caro)
2016/01/12 12:40:58 [Caro] crontab: PID 1424: (Caro) BEGIN EDIT (Caro)
2016/01/12 12:41:26 [Caro] crontab: PID 1424: (Caro) REPLACE (Caro)
2016/01/12 12:41:26 [Caro] crontab: PID 1424: (Caro) END EDIT (Caro)
2016/01/12 12:42:35 [Caro] crontab: PID 4284: (Caro) LIST (Caro)
2016/01/12 12:42:43 [Caro] crontab: PID 9036: (Caro) BEGIN EDIT (Caro)
2016/01/12 12:43:01 [SYSTEM] /usr/sbin/cron: PID 3284: (Caro) CMD (touch 
$HOME/timestamp)
2016/01/12 12:43:01 [SYSTEM] /usr/sbin/cron: PID 3284: (CRON) error (can't 
switch user context)
2016/01/12 12:43:05 [Caro] crontab: PID 9036: (Caro) REPLACE (Caro)
2016/01/12 12:43:05 [Caro] crontab: PID 9036: (Caro) END EDIT (Caro)
2016/01/12 12:43:48 [Caro] crontab: PID 2964: (Caro) LIST (Caro)
2016/01/12 12:44:01 [SYSTEM] /usr/sbin/cron: PID 3044: (Caro) RELOAD (tabs/Caro)
2016/01/12 12:44:01 [SYSTEM] /usr/sbin/cron: PID 4228: (Caro) CMD (touch 
$HOME/timestamp)
2016/01/12 12:44:01 [SYSTEM] /usr/sbin/cron: PID 4228: (CRON) error (can't 
switch user context)
2016/01/12 12:45:02 [SYSTEM] /usr/sbin/cron: PID 3412: (Caro) CMD (touch 
~/timestamp)
2016/01/12 12:45:02 [SYSTEM] /usr/sbin/cron: PID 3412: (CRON) error (can't 
switch user context)
2016/01/12 12:46:01 [SYSTEM] /usr/sbin/cron: PID 2496: (Caro) CMD (touch 
~/timestamp)
2016/01/12 12:46:01 [SYSTEM] /usr/sbin/cron: PID 2496: (CRON) error (can't 
switch user context)
2016/01/12 12:47:01 [SYSTEM] /usr/sbin/cron: PID 7932: (Caro) CMD (touch 
~/timestamp)
2016/01/12 12:47:01 [SYSTEM] /usr/sbin/cron: PI

RE: Unable to run excel via cron

2015-06-25 Thread Kertz, Denis (D)** CTR **
I'm not sure but I think Larry was saying the issue was that Excel by its 
nature is an interactive program and that was the crux of the problem, even 
though I was running Excel without any interactive input.  (And Larry wanted to 
emphasize this wasn't a cygwin problem per se - it was a problem with getting 
cygwin/cron to function within the windows structure.)

However, sometimes you get lucky even though you don't quite know what you are 
doing.  Having given up on being able to run Excel from a cron I started 
investigating running a bash script via the windows task scheduler 
(http://www.davidjnice.com/cygwin_scheduled_tasks.html).  A colleague of mine 
had already set up some Excel programs running from the task scheduler and I 
checked them out and noticed he ran them via a vbscript by creating a shell to 
run the Excel programs.  A light bulb went off and, guessing that a shell is by 
definition able to handle an interactive program like Excel, I ran this 
vbscript from a cron job (run with c:/Windows/System32/wscript.exe):

Dim objShell
Set objShell = Wscript.CreateObject("WScript.Shell")
objShell.Run "C:\cygwin64\home\\TestExcel.xls", 1, true
Set objShell = Nothing

This worked!  The cron ran the TestExcel.xls via WScript.Shell and this .xls 
saved itself (saveas) as a .htm file.  This demonstrated that an Excel program 
could be run and it could create a file.  This also worked with the cron set up 
to run either under cygserver or my cygwin login.

There was one wrinkle here.  The previous script that wouldn't run under Win7 
was set up to initiate the Excel program and then terminate it.  This shell 
approach initiated the Excel program but left the Excel program still running.  
I had to add an explicit 'Application.Quit' in my Excel macro to force the 
termination of Excel, a fairly minor change.

Thanks to all who helped me reach this solution.  Hopefully it may help others 
with a similar problem.

Denis

-
Andy Hall wrote:

I think Denis is saying Excel hangs even if it doesn't require user 
interaction. 
 I.e.  it runs some macros and exits.   On Win7 Pro, I was able to run the 
following 
.vbs script via the task scheduler and have it run the  "AddTimeInColumn" macro.
The resulting spreadsheet had the times the task was run column A.

Andy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-24 Thread Andy Hall

> On 06/23/2015 09:39 AM, Kertz, Denis (D)** CTR ** wrote:
> > I changed the cron setup to use cygserver as Corinna suggested.  I used
> > cron-config and cygserver-config to setup the cron and cygserver services
> > and passwd -R to establish my password.  Normal cron jobs run under this
> > setup but Excel still hangs as it did before.  I also tried this on the
> > Win7 PC that I thought worked at one time but it behaved the same with
> > Excel hanging.
> >
> > So it looks like Corinna's first case is the situation - there is no
> > solution.  There apparently is something unique about Excel that will not
> > run in this Win7 cron environment.
> 
> It's actually not unique to Excel and it's not peculiar to Cygwin's cron.
> Any program that requires desktop interaction to run would suffer this same
> limitation on Vista and beyond if started from a service.  In the Cygwin
> environment, cron is run as a service and used to start programs, so it's
> the obvious 'culprit' reported here but it's just one of many possible
> vectors that exhibit the unwanted behavior on Windows.  Just FYI.
> 
> --
> Larry
> 
I think Denis is saying Excel hangs even if it doesn't require user 
interaction. 
 I.e.  it runs some macros and exits.   On Win7 Pro, I was able to run the 
following 
.vbs script via the task scheduler and have it run the  "AddTimeInColumn" macro.
The resulting spreadsheet had the times the task was run column A.

Andy

Here's the .vbs script:

Dim args, objExcel

Set args = WScript.Arguments
Set objExcel = CreateObject("Excel.Application")

objExcel.Workbooks.Open("C:\cygwin64\home\Andy\ExcelTest\TestExcel.xlsm")
objExcel.Visible = True

objExcel.Run "AddTimeInColumn"

objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close(0)
objExcel.Quit

Here's the macro:

Public Sub AddTimeInColumn()

Dim LastRowInColumn As Long

LastRowInColumn = Cells(Cells.Rows.Count, "A").End(xlUp).Row

'If column is completely blank, need to adjust last row
If Cells(LastRowInColumn, "A").Value = "" Then LastRowInColumn = 0

'Insert time in next row
Cells(LastRowInColumn + 1, "A").Value = Time()

End Sub




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Unable to run excel via cron

2015-06-23 Thread Larry Hall (Cygwin)

On 06/23/2015 09:39 AM, Kertz, Denis (D)** CTR ** wrote:

I changed the cron setup to use cygserver as Corinna suggested.  I used
cron-config and cygserver-config to setup the cron and cygserver services
and passwd -R to establish my password.  Normal cron jobs run under this
setup but Excel still hangs as it did before.  I also tried this on the
Win7 PC that I thought worked at one time but it behaved the same with
Excel hanging.

So it looks like Corinna's first case is the situation - there is no
solution.  There apparently is something unique about Excel that will not
run in this Win7 cron environment.


It's actually not unique to Excel and it's not peculiar to Cygwin's cron.
Any program that requires desktop interaction to run would suffer this same
limitation on Vista and beyond if started from a service.  In the Cygwin
environment, cron is run as a service and used to start programs, so it's
the obvious 'culprit' reported here but it's just one of many possible
vectors that exhibit the unwanted behavior on Windows.  Just FYI.

--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-23 Thread Kertz, Denis (D)** CTR **
I changed the cron setup to use cygserver as Corinna suggested.  I used 
cron-config and cygserver-config to setup the cron and cygserver services and 
passwd -R to establish my password.  Normal cron jobs run under this setup but 
Excel still hangs as it did before.  I also tried this on the Win7 PC that I 
thought worked at one time but it behaved the same with Excel hanging.

So it looks like Corinna's first case is the situation - there is no solution.  
There apparently is something unique about Excel that will not run in this Win7 
cron environment.

Denis

---

Corinna Write:

Two possible solutions come to mind:

- Either there is no solution.  The reason might be that Excel is
  expecting a GUI it can't connect to.

- Or it's about the user token after switching the user context.  I
  assume you're running Excel from cron as some other user account than
  cyg_server.  Please read
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview  and try
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3


Corinna

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-18 Thread Kertz, Denis (D)** CTR **
Well, not so lucky anymore.  Last night I re-ran my Excel test on the Win7 PC 
that worked previously and now it doesn't work.  So I guess some Win7 patch 
must have come along and "fixed" something.

Denis

Larry Hall wrote:

On 06/17/2015 12:55 PM, Kertz, Denis (D)** CTR ** wrote:
> We are running cron under the specific cygwin login (not cyg_server).

> Presumably there is a solution to this problem. We have 3 Win7 Pro PCs
> and  this works on one of the PCs (unfortunately, not the one where we need 
> it to
> work) and fails on the other two PCs.

The behavior here has always been somewhat unpredictable.  Some have luck
getting this to work post-XP, some don't.  Some, like you, sometimes have
luck.  It's not clear why.  But it is clear that MS changed the behavior
in Vista and beyond for security reasons.  They are trying to make this
difficult if not impossible to do.  As Corinna mentioned, getting an
Windows authenticated token for the user running the server may help.
Or not. ;-)

--
Larry


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Unable to run excel via cron

2015-06-17 Thread Larry Hall (Cygwin)

On 06/17/2015 12:55 PM, Kertz, Denis (D)** CTR ** wrote:

We are running cron under the specific cygwin login (not cyg_server).

Presumably there is a solution to this problem. We have 3 Win7 Pro PCs
and  this works on one of the PCs (unfortunately, not the one where we need it 
to
work) and fails on the other two PCs.


The behavior here has always been somewhat unpredictable.  Some have luck
getting this to work post-XP, some don't.  Some, like you, sometimes have
luck.  It's not clear why.  But it is clear that MS changed the behavior
in Vista and beyond for security reasons.  They are trying to make this
difficult if not impossible to do.  As Corinna mentioned, getting an
Windows authenticated token for the user running the server may help.
Or not. ;-)

--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-17 Thread Kertz, Denis (D)** CTR **
We are running cron under the specific cygwin login (not cyg_server).

Presumably there is a solution to this problem.  We have 3 Win7 Pro PCs and 
this works on one of the PCs (unfortunately, not the one where we need it to 
work) and fails on the other two PCs.

Thanks for the two suggested links.  We will check them out.

Denis



Corinna Vinschen Wrote:

On Jun 17 13:29, Kertz, Denis (D)** CTR ** wrote:
> Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
> behavior as before with excel hanging.
> 
> We are using 64-bit cygwin and 32-bit Excel (Excel 2007).

The problem is probably related to some of the changes between XP and
W7.  On XP, the desktop runs in session 0, just like the services.  With
UAC since Vista, the desktop runs in session 1, while the services
continue to run in session 0.  Therefore services are not allowed to
connect to the desktop anymore since Vista.  UAC itself, as well as
a feature since Windows 2003 (permissions of LocalSystem) may come into
play here as well.  Are you running cron under the cyg_server account
on W7 (hopefully)?

Two possible solutions come to mind:

- Either there is no solution.  The reason might be that Excel is
  expecting a GUI it can't connect to.

- Or it's about the user token after switching the user context.  I
  assume you're running Excel from cron as some other user account than
  cyg_server.  Please read
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview
  and try
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3


Corinna

-- 
Corinna Vinschen


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-17 Thread Andy Hall

> -Original Message-
> From: cygwin-ow...@cygwin.com [mailto:cygwin-ow...@cygwin.com] On Behalf Of 
> Kiehl, Horst
> Sent: Wednesday, June 17, 2015 8:10 AM
> To: Kertz, Denis (D)** CTR **; cygwin@cygwin.com
> Subject: RE: Unable to run excel via cron
> 
> (Trying to remove TOFU to make the conversation appear chronological again 
> and with correct attributions.)
> 
> Kertz, Denis (D)** CTR **  wrote:
> > > > We need to run some Excel programs via cron and are using vbscript to 
> > > > do this.  We have this running on a WinXP
> machine but are having trouble running on a Win7 machine, but we don't think 
> it is a Win7 problem.
> > > >
> > > > Here's the script to run a simple test excel program:
> > > >
> > > > [...]
> 
> Bryan Berns wrote:
> > > What bitness of Excel and Cygwin are you running?
> > >
> > > CreateObject("Excel.application") will attempt to create a 32-bit
> > > instance of Excel when launched through the 32-bit version of
> > > wscript.exe or a 64-bit instance of Excel when launched through the
> > > 64-bit version of Excel.  Which bitness of WScript.exe ends up being
> > > run will depend on the bitness of the parent program (which may be
> > > different in a command prompt vice Cygwin).  Try changing it to run
> > > Wscript.exe in SysWow64 instead of System32 (which is subject to
> > > automatic redirection) and see if changes the behavior.  If you're not
> > > running a 64-bit OS, then just ignore everything I said.
> 
> Kertz, Denis (D)** CTR ** wrote:
> 
> > Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
> > behavior as before with excel hanging.
> >
> > We are using 64-bit cygwin and 32-bit Excel (Excel 2007).
> 
> Although the aspect Corinna wrote about may be the culprit already,
> just in case:
> 
> It appears that you, Denis, were misunderstanding Bryan. The consequence
> of what he tried to point out might be that you, using 64-bit Cygwin and
> 32-bit Excel, would have to explicitly use the 32-bit wscript.exe
> instead of the 64-bit wscript.exe, to make sure that wscript.exe
> (32-bit) will start Excel (32-bit) successfully. In other words, you
> might have to use $windir/SysWOW64/wscript.exe (i.e.
> %windir%\SysWOW64\wscript.exe) from your 64-bit Cygwin process.
> 
> (The reason for the seemingly backwards 32-bitness and 64-bitness of
> executables in SysWOW64 and system32, respectively, if viewed from a
> 64-bit process, is to make code with hardcoded "system32", whether
> compiled or interpreted, continue to work in a 64-bit context as well as
> in a 32-bit context.)
> 
> Horst
> 
Years ago,  I had a similar problem on Windows Server 2003.  I needed to run a 
component of Visual Studio in a
Cygwin-based nightly build system.   It would not run unless Visual Studio was 
running prior to the builds starting.   I
solved it by first bringing up Visual Studio this way.

VISUAL_STUDIO="Microsoft Visual Studio 8"

ps -W | grep -q "$VISUAL_STUDIO" || \
cygstart --showminnoactive \
"/cygdrive/c/Program Files/$VISUAL_STUDIO/Common7/IDE/devenv.exe" /edit

So my question is, does having the Excel UI visible prior to running the cron 
job help?  

The other difference is I used the Windows Task Scheduler instead of cron to 
kick off the nightly build.   The .bat file
(still running, but obviously obsolete)  is

==
@echo off

C:
chdir C:\cygwin\bin

rem set CYGWIN=ntsec
set CYGWIN=binmode,nodosfilewarning

bash --login -i "/home/build/bin/nightly_bootstrap.sh"
==

This seemed to side-step any problems resulting from the differences in 
permission handling between Cygwin and Windows.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-17 Thread Kertz, Denis (D)** CTR **
Yes, I was confused, by the system32, but I still managed to do what was 
suggested.  Previously I was running:

c:/Windows/System32/wscript.exe 'c:\cygwin64\home\Upar3\tst.vbs'

Then as suggested I ran:

c:/Windows/SysWow64/wscript.exe 'c:\cygwin64\home\Upar3\tst.vbs'

Both versions of wscript.exe resulted in the same behavior - excel hung.

Denis



Kiehl, Horst wrote:

Yes, I was confused, by the system32 but I still managed to do what was 
suggested.

(Trying to remove TOFU to make the conversation appear chronological again and 
with correct attributions.)

Kertz, Denis (D)** CTR **  wrote:
> > > We need to run some Excel programs via cron and are using vbscript to do 
> > > this.  We have this running on a WinXP machine but are having trouble 
> > > running on a Win7 machine, but we don't think it is a Win7 problem.
> > >
> > > Here's the script to run a simple test excel program:
> > >
> > > [...]

Bryan Berns wrote:
> > What bitness of Excel and Cygwin are you running?
> >
> > CreateObject("Excel.application") will attempt to create a 32-bit
> > instance of Excel when launched through the 32-bit version of
> > wscript.exe or a 64-bit instance of Excel when launched through the
> > 64-bit version of Excel.  Which bitness of WScript.exe ends up being
> > run will depend on the bitness of the parent program (which may be
> > different in a command prompt vice Cygwin).  Try changing it to run
> > Wscript.exe in SysWow64 instead of System32 (which is subject to
> > automatic redirection) and see if changes the behavior.  If you're not
> > running a 64-bit OS, then just ignore everything I said.

Kertz, Denis (D)** CTR ** wrote:

> Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
> behavior as before with excel hanging.
>
> We are using 64-bit cygwin and 32-bit Excel (Excel 2007).

Although the aspect Corinna wrote about may be the culprit already,
just in case:

It appears that you, Denis, were misunderstanding Bryan. The consequence
of what he tried to point out might be that you, using 64-bit Cygwin and
32-bit Excel, would have to explicitly use the 32-bit wscript.exe
instead of the 64-bit wscript.exe, to make sure that wscript.exe
(32-bit) will start Excel (32-bit) successfully. In other words, you
might have to use $windir/SysWOW64/wscript.exe (i.e.
%windir%\SysWOW64\wscript.exe) from your 64-bit Cygwin process.

(The reason for the seemingly backwards 32-bitness and 64-bitness of
executables in SysWOW64 and system32, respectively, if viewed from a
64-bit process, is to make code with hardcoded "system32", whether
compiled or interpreted, continue to work in a 64-bit context as well as
in a 32-bit context.)

Horst

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to run excel via cron

2015-06-17 Thread Kiehl, Horst
(Trying to remove TOFU to make the conversation appear chronological again and 
with correct attributions.)

Kertz, Denis (D)** CTR **  wrote:
> > > We need to run some Excel programs via cron and are using vbscript to do 
> > > this.  We have this running on a WinXP machine but are having trouble 
> > > running on a Win7 machine, but we don't think it is a Win7 problem.
> > >
> > > Here's the script to run a simple test excel program:
> > >
> > > [...]

Bryan Berns wrote:
> > What bitness of Excel and Cygwin are you running?
> >
> > CreateObject("Excel.application") will attempt to create a 32-bit
> > instance of Excel when launched through the 32-bit version of
> > wscript.exe or a 64-bit instance of Excel when launched through the
> > 64-bit version of Excel.  Which bitness of WScript.exe ends up being
> > run will depend on the bitness of the parent program (which may be
> > different in a command prompt vice Cygwin).  Try changing it to run
> > Wscript.exe in SysWow64 instead of System32 (which is subject to
> > automatic redirection) and see if changes the behavior.  If you're not
> > running a 64-bit OS, then just ignore everything I said.

Kertz, Denis (D)** CTR ** wrote:

> Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
> behavior as before with excel hanging.
>
> We are using 64-bit cygwin and 32-bit Excel (Excel 2007).

Although the aspect Corinna wrote about may be the culprit already,
just in case:

It appears that you, Denis, were misunderstanding Bryan. The consequence
of what he tried to point out might be that you, using 64-bit Cygwin and
32-bit Excel, would have to explicitly use the 32-bit wscript.exe
instead of the 64-bit wscript.exe, to make sure that wscript.exe
(32-bit) will start Excel (32-bit) successfully. In other words, you
might have to use $windir/SysWOW64/wscript.exe (i.e.
%windir%\SysWOW64\wscript.exe) from your 64-bit Cygwin process.

(The reason for the seemingly backwards 32-bitness and 64-bitness of
executables in SysWOW64 and system32, respectively, if viewed from a
64-bit process, is to make code with hardcoded "system32", whether
compiled or interpreted, continue to work in a 64-bit context as well as
in a 32-bit context.)

Horst




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Unable to run excel via cron

2015-06-17 Thread Corinna Vinschen
On Jun 17 13:29, Kertz, Denis (D)** CTR ** wrote:
> Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
> behavior as before with excel hanging.
> 
> We are using 64-bit cygwin and 32-bit Excel (Excel 2007).

The problem is probably related to some of the changes between XP and
W7.  On XP, the desktop runs in session 0, just like the services.  With
UAC since Vista, the desktop runs in session 1, while the services
continue to run in session 0.  Therefore services are not allowed to
connect to the desktop anymore since Vista.  UAC itself, as well as
a feature since Windows 2003 (permissions of LocalSystem) may come into
play here as well.  Are you running cron under the cyg_server account
on W7 (hopefully)?

Two possible solutions come to mind:

- Either there is no solution.  The reason might be that Excel is
  expecting a GUI it can't connect to.

- Or it's about the user token after switching the user context.  I
  assume you're running Excel from cron as some other user account than
  cyg_server.  Please read
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview
  and try
  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpU_FzDNmUCu.pgp
Description: PGP signature


RE: Unable to run excel via cron

2015-06-17 Thread Kertz, Denis (D)** CTR **
Unfortunately, using the 64-bit wscript.exe didn't change anything - same 
behavior as before with excel hanging.

We are using 64-bit cygwin and 32-bit Excel (Excel 2007).

Denis

On Tue, Jun 16, 2015 at 9:27 AM, Kertz, Denis (D)** CTR **
 wrote:
> We need to run some Excel programs via cron and are using vbscript to do 
> this.  We have this running on a WinXP machine but are having trouble running 
> on a Win7 machine, but we don't think it is a Win7 problem.
>
> Here's the script to run a simple test excel program:
>
> Dim xlApp
> Dim xlWb
> Set xlApp = CreateObject("Excel.application")
> xlApp.Visible = True
> Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\TestExcel.xls")
> xlApp.Quit
> Set xlWb = Nothing
> Set xlApp = Nothing
>

What bitness of Excel and Cygwin are you running?

CreateObject("Excel.application") will attempt to create a 32-bit
instance of Excel when launched through the 32-bit version of
wscript.exe or a 64-bit instance of Excel when launched through the
64-bit version of Excel.  Which bitness of WScript.exe ends up being
run will depend on the bitness of the parent program (which may be
different in a command prompt vice Cygwin).  Try changing it to run
Wscript.exe in SysWow64 instead of System32 (which is subject to
automatic redirection) and see if changes the behavior.  If you're not
running a 64-bit OS, then just ignore everything I said.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Unable to run excel via cron

2015-06-16 Thread Bryan Berns
On Tue, Jun 16, 2015 at 9:27 AM, Kertz, Denis (D)** CTR **
 wrote:
> We need to run some Excel programs via cron and are using vbscript to do 
> this.  We have this running on a WinXP machine but are having trouble running 
> on a Win7 machine, but we don't think it is a Win7 problem.
>
> Here's the script to run a simple test excel program:
>
> Dim xlApp
> Dim xlWb
> Set xlApp = CreateObject("Excel.application")
> xlApp.Visible = True
> Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\TestExcel.xls")
> xlApp.Quit
> Set xlWb = Nothing
> Set xlApp = Nothing
>

What bitness of Excel and Cygwin are you running?

CreateObject("Excel.application") will attempt to create a 32-bit
instance of Excel when launched through the 32-bit version of
wscript.exe or a 64-bit instance of Excel when launched through the
64-bit version of Excel.  Which bitness of WScript.exe ends up being
run will depend on the bitness of the parent program (which may be
different in a command prompt vice Cygwin).  Try changing it to run
Wscript.exe in SysWow64 instead of System32 (which is subject to
automatic redirection) and see if changes the behavior.  If you're not
running a 64-bit OS, then just ignore everything I said.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Unable to run excel via cron

2015-06-16 Thread Kertz, Denis (D)** CTR **
We need to run some Excel programs via cron and are using vbscript to do this.  
We have this running on a WinXP machine but are having trouble running on a 
Win7 machine, but we don't think it is a Win7 problem. 

Here's the script to run a simple test excel program: 

Dim xlApp 
Dim xlWb 
Set xlApp = CreateObject("Excel.application") 
xlApp.Visible = True 
Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\TestExcel.xls") 
xlApp.Quit 
Set xlWb = Nothing 
Set xlApp = Nothing 

Here's how we run this test script from a terminal command prompt: 

c:/Windows/System32/wscript.exe 'c:\cygwin64\home\\tst.vbs' 

This runs fine from a command line prompt but hangs when run as a cron job.  We 
have trapped the error message we get when the workbooks.Open is executed and 
get this: 

Microsoft Office Excel cannot access the file 
'c:\Shared\Prospect\Bin\TestExcel.xls'. There are several possible reasons: 

▒ The file name or path does not exist. 
▒ The file is being used by another program. 
▒ The workbook you are trying to save has the same name as a currently open 
workbook. 

We don't believe any of these possible reasons apply.  In particular, since it 
looked like this could be a permission issue, we changed the vbscript to simply 
copy the TestExcel.xls file and that works fine:

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\Shared\Prospect\Bin\TestExcel.xls") Then
    filesys.CopyFile "c:\Shared\Prospect\Bin\TestExcel.xls", 
"c:\cygwin64\home\\"
Else
    WScript.Echo "file does not exist"
End If

This hanging also happens if we create a new spreadsheet and try to save it 
(and this works fine from a command line prompt).  So we can run excel programs 
from a cron job as long as we don't open an excel program or save a 
spreadsheet, which means it is useless. 

We also have a couple of other Win7 PCs.  This problem happens on 2 of the 3 
Win7 PCs but works on one of the Win7 PCs.  All 3 PCs are running Excel 2007 
SP3.  Two of these 3 PCs have the exact same version of Excel 2007 and one 
works and the other doesn't.

Anybody have any idea what could be going on here?  We only have this cron job 
problem when running an excel program via vbscript.  We haven't had any cron 
job problems with other non-excel scripts. 

Denis

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Cron Service

2015-04-21 Thread Kizito Porta Balanyà
Hello,

Installing the cron service, shows the name "Cron daemon" in the
service manager.

In my opinion, it should be better to follow the convention: "CYGWIN
servicenamed"

For example, the other CYGWIN services show: "CYGINW syslogd". "CYGWIN sshd" ...

The resulting display name should be "CYGWIN crond".

It is only a suggestion.

Thanks a lot for your time.

Regards.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cron not working

2015-03-10 Thread Larry Hall (Cygwin)

On 03/10/2015 09:48 AM, Stefan Schumacher wrote:


Hello

I am trying to set up a cron job to run a script every 10 minutes. I
have installed cron via the installer and configured it with cron-config
  to run as a system service.
Mar 10 14:11:33 stefan-PC cron: PID 3408: `cron' service started

This is stefan's crontab, generated with crontab -e.
*/10 * * * * /cygdrive/c/Users/stefan/copy_from_fileserver

According to /var/log/messages the cron job is executed correctly, but
no test file is generated in the directory. Calling copy_from_fileserver
  from the command line works without complications and copies the
file from the server as it should.

Mar 10 14:40:01 stefan-PC /usr/sbin/cron: PID 2340: (stefan) CMD 
(/cygdrive/c/Users/stefan/copy_from_fileserver)

How can I get this working?


First, we need to know what your script is doing and what your configuration
is, both for cron and for Cygwin.  Check out the problem reporting
guidelines at the link below for details.


Problem reports:   http://cygwin.com/problems.html


Just a wild guess based on what you said so far, your script requires
resources (paths, environment variables, permissions, etc.) that aren't
available to the script when it runs.  Keep in mind that the script isn't
being run by your user and as a result, you can't assume that your user's
environment exists when it runs.  If your script assumes these things, it
will fail.  To solve this problem, you need to identify the needed resources
and make sure they are available when the script runs.  This may be as
simple as running the crond service under your user's account (this means
that the service can _only_ service your user's account though) or adding
some needed environment to your script.


--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Cron not working

2015-03-10 Thread Stefan Schumacher

Hello

I am trying to set up a cron job to run a script every 10 minutes. I 
have installed cron via the installer and configured it with cron-config
 to run as a system service.
Mar 10 14:11:33 stefan-PC cron: PID 3408: `cron' service started

This is stefan's crontab, generated with crontab -e.
*/10 * * * * /cygdrive/c/Users/stefan/copy_from_fileserver

According to /var/log/messages the cron job is executed correctly, but 
no test file is generated in the directory. Calling copy_from_fileserver
 from the command line works without complications and copies the 
file from the server as it should.

Mar 10 14:40:01 stefan-PC /usr/sbin/cron: PID 2340: (stefan) CMD 
(/cygdrive/c/Users/stefan/copy_from_fileserver)

How can I get this working? 

Yours

Stefan





--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] Updated: cron 4.1

2015-01-23 Thread Pierre A Humblet
A new release of the Cygwin port of cron 4.1 is available in the 32-bit and
64-bit Cygwin distributions.

The change allows the cron-config script to handle new cron installations in
the upcoming Cygwin release, which does not rely on /etc/{password,group}.

Pierre

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com , mentioning cron in
the subject line.


  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look at
the "List-Unsubscribe: " tag in the email header of this message. Send email
to the address specified there. It will be in the format:

 cygwin-announce-unsubscribe-you=yourdomain.com  cygwin.com

 If you need more information on unsubscribing, start reading here:

 http://sourceware.org/lists.html#unsubscribe-simple

 Please read *all* of the information on unsubscribing that is available
starting at this URL.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2015-01-12 Thread Kertz, Denis (D)** CTR **
After more investigation, I agree that this isn't a cywin problem but this 
isn't a GUI issue either.  Something very strange is going on.

Here is a test vb script to control Excel using the wscript engine 
(c:/Windows/System32/wscript.exe).  This vb script simply starts Excel, opens a 
.csv file (c:\Shared\Prospect\Bin\test.csv), and terminates:

Dim xlApp
Dim xlWb

Set xlApp = CreateObject("Excel.application")
xlApp.Visible = True
Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\test.csv")
xlApp.Quit
Set xlWb = Nothing
Set xlApp = Nothing

Here is the cron job to run this vb script:

c:/Windows/System32/wscript.exe 
"c:\cygwin64\home\Upar2\bin\testExcel.vbs"

When this cron job is run, it hangs with Excel running (and doing nothing).

However, if the line that opens the .csv file is removed from this script:
Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\test.csv")
Then the script runs successfully.  That shows the cron job is running 
successfully for this trivial Excel program that simply starts Excel and 
terminates Excel.

This suggests there is a permission issue with opening the test.csv file but 
that isn't the case.  A cron job was run to simply cat the test.csv file and 
this works:

cat  c:/Shared/Prospect/Bin/test.csv  >$HOME/cat.out

Finally, as was previously suggested, this script was executed using the runas 
command and that works successfully:

runas  /user:\Upar2  "c:\Windows\System32\wscript.exe  
c:\cygwin64\home\Upar2\bin\testExcel.vbs"

A variation of this Excel script was created to create a new workbook 
(xlApp.Workbooks.Add) and save the workbook as a .xls file.  This also results 
in Excel hanging when run as a cron job.

So it appears the Excel script runs successfully as a cron job as long as no 
file operation (read or write) is performed which, of course, means no useful 
Excel script can be run.

Any ideas?

Denis

-Original Message-
From: Andrey Repin [mailto:anrdae...@yandex.ru] 
Sent: Sunday, December 21, 2014 6:03 PM
To: Kertz, Denis (D)** CTR **; cygwin@cygwin.com
Subject: [SPAM?] Re: Can't Run Excel From A Cron Job Under Windows 7

Greetings, Kertz, Denis (D)** CTR **!

> I am trying to port a cygwin application that uses cron from a WinXP PC to
> a Win7 Pro PC and I find some cron jobs won't run.  Specifically, I need to
> run an Excel program from a cron job and this doesn't work on my Win7 PC.

For posterity:
Turned out, this has nothing to do with cygwin (predictable), and actually has
to do with how Windows (Vista+) manage services (namely: lack of access to any
GUI, unless you create one for yourself).

The issue has been discussed, for example, at serverfault.com[1] and relevant
MSDN article is [2].
The solution could be to create a stub application, which will make all
necessary calls and then launch your GUI application in prepared environment.

[1] http://serverfault.com/questions/101671/scheduled-tasks-w-gui-issue
[2] http://msdn.microsoft.com/en-us/library/ms687105(VS.85).aspx

> In order to run an Excel program from cygwin I have this run.excel bash
> script with an embedded VB script that executes an Excel program:

> excel=$1
> vbscript=/usr/tmp/$$.vbs
> cat <<-! >$vbscript
> Dim xlApp
> Set xlApp = CreateObject("Excel.application")
> Set xlWb = xlApp.workbooks.Open("$excel")
> xlApp.Quit
> Set xlWb = Nothing
> Set xlApp = Nothing
> !
> chmod 777  $vbscript
> c:/Windows/System32/wscript.exe  'c:\cygwin64\usr\tmp\$$.vbs'

> An excel program is run like this:

> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'

> When I run an Excel program interactively with this run.excel script it
> runs just fine but when I run it via a cron job Excel just hangs.  When
> Excel hangs I can look at the processes running on the PC using the Windows
> Task Manager and I don't see the EXCEL.EXE process.  But when I check the
> option to show processes from all users I see the hung EXCEL.EXE process,
> AND the user name displayed is my login.  So I am running this under the
> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
> but when I check 'Show processes from all users' it shows EXCEL.EXE running
> under user name Upar2 - a contradiction.

> What I suspect is happening is Excel is attempting to do something that
> requires Upar2 permission but it isn't really running as Upar2 so Excel
> displays some error message and is waiting for the user to respond.  But
> Excel is runnin

Re: Can't Run Excel From A Cron Job Under Windows 7

2014-12-21 Thread Andrey Repin
Greetings, Kertz, Denis (D)** CTR **!

> I am trying to port a cygwin application that uses cron from a WinXP PC to
> a Win7 Pro PC and I find some cron jobs won't run.  Specifically, I need to
> run an Excel program from a cron job and this doesn't work on my Win7 PC.

For posterity:
Turned out, this has nothing to do with cygwin (predictable), and actually has
to do with how Windows (Vista+) manage services (namely: lack of access to any
GUI, unless you create one for yourself).

The issue has been discussed, for example, at serverfault.com[1] and relevant
MSDN article is [2].
The solution could be to create a stub application, which will make all
necessary calls and then launch your GUI application in prepared environment.

[1] http://serverfault.com/questions/101671/scheduled-tasks-w-gui-issue
[2] http://msdn.microsoft.com/en-us/library/ms687105(VS.85).aspx

> In order to run an Excel program from cygwin I have this run.excel bash
> script with an embedded VB script that executes an Excel program:

> excel=$1
> vbscript=/usr/tmp/$$.vbs
> cat <<-! >$vbscript
> Dim xlApp
> Set xlApp = CreateObject("Excel.application")
> Set xlWb = xlApp.workbooks.Open("$excel")
> xlApp.Quit
> Set xlWb = Nothing
> Set xlApp = Nothing
> !
> chmod 777  $vbscript
> c:/Windows/System32/wscript.exe  'c:\cygwin64\usr\tmp\$$.vbs'

> An excel program is run like this:

> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'

> When I run an Excel program interactively with this run.excel script it
> runs just fine but when I run it via a cron job Excel just hangs.  When
> Excel hangs I can look at the processes running on the PC using the Windows
> Task Manager and I don't see the EXCEL.EXE process.  But when I check the
> option to show processes from all users I see the hung EXCEL.EXE process,
> AND the user name displayed is my login.  So I am running this under the
> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
> but when I check 'Show processes from all users' it shows EXCEL.EXE running
> under user name Upar2 - a contradiction.

> What I suspect is happening is Excel is attempting to do something that
> requires Upar2 permission but it isn't really running as Upar2 so Excel
> displays some error message and is waiting for the user to respond.  But
> Excel is running invisibly so this can't be seen.

> I also suspect this Upar2 "confusion" isn't limited to running an Excel
> program.  I can run a cron job with regular UNIX commands (cut, sort, etc)
> and see they are running with the ps command.  But when I try to kill them
> (kill -9) I get permission denied.  If I want to kill a process running via
> the cron I have to start cygwin with 'Run as administrator' and then I can
> kill processes running under the cron.

> So, does anyone know what's going on here and what I need to do get these
> cron jobs running.  As I noted at the beginning this is being ported from
> WinXP, where all this works fine, to Win7.

> I set up cron using cron-config like this:

> $ cron-config
> Do you want to install the cron daemon as a service? (yes/no) yes
> Enter the value of CYGWIN for the daemon: [ ]

> Do you want the cron daemon to run as yourself? (yes/no) yes

> Please enter the password for user 'Upar2':
> Reenter:
> Running cron_diagnose ...
> ... 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.

> Denis


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 22.12.2014, <02:37>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-19 Thread Andrey Repin
Greetings, Kertz, Denis (D)** CTR **!

>>>> Try starting cron in terminal session and see if anything comes up.
>>
>> Stop (don't kill! Everyone, who use -KILL, must be -KILL'ed) the cron 
>> service,
>> then start cron in terminal, using `runas /user:... ...'. So it would run
>> under proper user, and see if anything come up, when it execute your excel
>> job.

> I was unable to find how to use runas from a terminal.

runas supply a plentiful help page when started without any parameters.
Your problem is probably that you assume the mintty to be the way to go, or
sort of a requirement, which it isn't.
runas is a windows tool to start applications under different credentials. And
as any native tool, it has no concept of pty's, and unlikely to output
anything to the mintty.
You can overcome this with redirection to an extent, i.e.
runas | iconv -f 

> I can simply type runas and it does nothing and I can't find --help or
> /help.  I did find a suggestion to use cygstart

cygstart is a cygwin analogue for START command. Not the tool for the job.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 19.11.2014, <16:19>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-18 Thread Warren Young
On Nov 12, 2014, at 9:20 AM, Kertz, Denis (D)** CTR ** 
 wrote:

>> More like you expect to run Excel interactively from service.
>> Not possible. Period.
> 
> I'm not trying to run Excel interactively from a cron job.  One of the 
> limitations with using Excel from a cron job is Excel has to run error free. 

That’s not the key issue here.

Windows does not allow a service to have a GUI, at all.[1]  Unless Excel is 
smart enough to not even start its GUI loop when it sees that it is running as 
a service — as it will be when running under “cron as service” — it will fail.

You were offered a choice when running cron-config: to run as a service or not. 
 If you installed it as a service, try removing the Cygwin cron service[2] and 
reinstalling it to run under your user account.  I tested it here, and a Bash 
script was able to launch notepad.exe via cron when run this way.

(I did not test the run-as-service case since I haven’t changed my user 
permissions per[3] on my test VM, and I don’t want to.  And per above, I do not 
think it would succeed anyway.)

This means you will have to leave that computer logged in all the time.  You 
also need to ensure that /usr/sbin/cron.exe starts on each login.  As soon as 
you log out — and possibly if the desktop gets locked — cron will go back to 
failing to run GUI programs.

If this also fails, try using the Windows Task Scheduler instead.  It’s more 
suited to this sort of task.

For that matter, why bring Cygwin into this at all?  You’re clearly already 
familiar with VBScript, so why not create a VB app to do all the CreateObject() 
stuff?

If your excuse is that you don’t have Visual Studio, then you have no excuse, 
since there is a free version that will suffice for such a simple task.[4][5]


[1] http://stackoverflow.com/questions/53232/
[2] cygrunsrv -R cron
[3] http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
[4] http://www.visualstudio.com/products/visual-studio-express-vs
[5] Beware, VSE will go away eventually: http://goo.gl/Cjmq2q
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Can't Run Excel From A Cron Job Under Windows 7

2014-11-17 Thread Kertz, Denis (D)** CTR **
>>> Try starting cron in terminal session and see if anything comes up.
>
> Stop (don't kill! Everyone, who use -KILL, must be -KILL'ed) the cron service,
> then start cron in terminal, using `runas /user:... ...'. So it would run
> under proper user, and see if anything come up, when it execute your excel
> job.

I was unable to find how to use runas from a terminal.  I can simply type runas 
and it does nothing and I can't find --help or /help.  I did find a suggestion 
to use cygstart so I tried this:

$ cygstart --action=runas '/bin/cygrunsrv --start cron'
Unable to start 'C:\cygwin64\bin\cygrunsrv --start cron': The specified file 
was not found.

So that didn't work.  I did try starting the cron service (cygrunsrv) from a 
terminal session run as administrator and I tried starting the cron service 
from the Windows services.msc.  Nothing has worked for running an Excel program 
with my run.excel script.

I created a "null" .xls file that does nothing when run by Excel.  I can run my 
script (run.excel  c:/Shared/Bin/null.xls) from a bash prompt and it does 
nothing (as expected) and terminates but when I run this same script from a 
cron job Excel starts but never terminates.  Running a ps command I see this:

$ ps
  PIDPPIDPGID WINPID   TTY UIDSTIME COMMAND
 518811845188   4928  ?   1000 19:00:01 /usr/bin/sh
 604058205188   4428  ?   1000 19:00:02 
/cygdrive/c/Windows/System32/wscript  <-- runs vb script that starts Excel
 180844641808   5704  ?   1000 18:24:25 /usr/sbin/cron
 518455405184   6048  pty11000 21:13:03 /usr/bin/bash
 336851843368   5560  pty11000 19:00:25 /usr/bin/ps
 582051885188   5820  ?   1000 19:00:02 /usr/bin/sh
 4464   14464   4464  ?   1000 18:24:25 /usr/bin/cygrunsrv
 118418081808   1184  ?   1000 19:00:01 /usr/sbin/cron
 5540   15540   5540  ?   1000 21:13:03 /usr/bin/mintty
$

And I see the Excel.Exe *32 in the process list of Task Manager so I know Excel 
was started.

Note the above ps command shows the wscript command running which is the 
command that executes the vb script that runs Excel.  Also note that all of 
these processes including the wscript command show the 1000 UID which is the 
Upar2 login UID in the /etc/passwd file.

I also look in the services.msc window and the cron service properties shows 
Login As .\Upar2.  I see the same on the WinXP PC where I can run Excel 
successfully from a cron job.

Denis

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-13 Thread Andrey Repin
Greetings, Kertz, Denis (D)** CTR **!

>>> What I mean by runs fine is that when I type this command at a bash prompt:
>>> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>>> it runs to completion and creates a new .xls as its output.  When I run
>>> this run.excel script from a cron job it hangs.
>>
>> Hangs as in - do not create new file?

> Hangs as in never finishes and I don't know what, if anything, it has done.
> But that suggests some tests for me to run that I should have thought of. 
> First, create a test .xls that does nothing and see if that runs to
> completion.  If it does, then create a test .xls that simply creates a file
> to test whether it actually creates the file.

:)

>>> I'm not trying to run Excel interactively from a cron job.  One of the
>>> limitations with using Excel from a cron job is Excel has to run error free.
>>> If Excel does run into some error it will typically generate an error
>>> message and wait for a user response.  Since Excel is running invisibly from
>>> a cron job, there is no user to give a response and Excel just sits there
>>> waiting for a response that will never come.
>>
>> Try starting cron in terminal session and see if anything comes up.

> Can you tell me how to do this?  When I run the ps command in a terminal 
> session, I see this:
> $ ps
>   PIDPPIDPGID WINPID   TTY UIDSTIME COMMAND
>  578055685780   3408  pty01000   Nov  5 /usr/bin/bash
>  5568   15568   5568  ?   1000   Nov  5 /usr/bin/mintty
>  371657803716   1016  pty01000 18:58:16 /usr/bin/ps
>  1820   11820   1820  ?   1000   Nov  5 /usr/bin/cygrunsrv
>  185618201856   1892  ?   1000   Nov  5 /usr/sbin/cron

> Do I have to kill the cygrunsrv and cron processes and then ??

Stop (don't kill! Everyone, who use -KILL, must be -KILL'ed) the cron service,
then start cron in terminal, using `runas /user:... ...'. So it would run
under proper user, and see if anything come up, when it execute your excel
job.

>>> Why "of course"?  Shouldn't I be able to kill my own processes?
>>
>> It's not "your own" process, it's "cron job" started with your credentials.
>>
>>> I can certainly do that under WinXP.
>>
>> Again, only if you logged in as admin.
>> This is not the case in Vista+ by default.

> Okay, I think what you are telling me is that the login I'm using on "my"
> WinXP PC (which I inherited) must be an administrator login

By default, the first user account created after system installation
(rid:1000), have admin rights. In any system, starting from Win2000.
However, WinXP has no concept of privilege escalation, and if you've had admin
rights, you were always working with them enabled.

> and the login
> I'm using on the Win7 PC is not an administrator login (it isn't).  That
> sounds plausible (I know a lot more about UNIX than I do about Windows).

Then just think as if you've been running as root in WinXP, but now, you're
running as user with access to sudo facility under Win7. This is not entirely
correct, but close enough to give you an idea.

> So
> the differences I'm seeing between WinXP and Win7 is due to using/not using
> an administrator login, not due to whether it is WinXP or Win7.

The difference is inherently architectural, and not directly related to using
or not using admin account.
I think we best keep discussion strictly relevant to your present issue.
If you want any more details on Win7 security "improvements", google "UAC
description".


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 14.11.2014, <01:14>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Can't Run Excel From A Cron Job Under Windows 7

2014-11-12 Thread Kertz, Denis (D)** CTR **
>> What I mean by runs fine is that when I type this command at a bash prompt:
>> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>> it runs to completion and creates a new .xls as its output.  When I run
>> this run.excel script from a cron job it hangs.
>
> Hangs as in - do not create new file?

Hangs as in never finishes and I don't know what, if anything, it has done.  
But that suggests some tests for me to run that I should have thought of.  
First, create a test .xls that does nothing and see if that runs to completion. 
 If it does, then create a test .xls that simply creates a file to test whether 
it actually creates the file.

>> I'm not trying to run Excel interactively from a cron job.  One of the
>> limitations with using Excel from a cron job is Excel has to run error free.
>> If Excel does run into some error it will typically generate an error
>> message and wait for a user response.  Since Excel is running invisibly from
>> a cron job, there is no user to give a response and Excel just sits there
>> waiting for a response that will never come.
>
> Try starting cron in terminal session and see if anything comes up.

Can you tell me how to do this?  When I run the ps command in a terminal 
session, I see this:
$ ps
  PIDPPIDPGID WINPID   TTY UIDSTIME COMMAND
 578055685780   3408  pty01000   Nov  5 /usr/bin/bash
 5568   15568   5568  ?   1000   Nov  5 /usr/bin/mintty
 371657803716   1016  pty01000 18:58:16 /usr/bin/ps
 1820   11820   1820  ?   1000   Nov  5 /usr/bin/cygrunsrv
 18561820    1856   1892  ?   1000   Nov  5 /usr/sbin/cron

Do I have to kill the cygrunsrv and cron processes and then ??

>> Why "of course"?  Shouldn't I be able to kill my own processes?
>
> It's not "your own" process, it's "cron job" started with your credentials.
>
>> I can certainly do that under WinXP.
>
> Again, only if you logged in as admin.
> This is not the case in Vista+ by default.

Okay, I think what you are telling me is that the login I'm using on "my" WinXP 
PC (which I inherited) must be an administrator login and the login I'm using 
on the Win7 PC is not an administrator login (it isn't).  That sounds plausible 
(I know a lot more about UNIX than I do about Windows).  So the differences I'm 
seeing between WinXP and Win7 is due to using/not using an administrator login, 
not due to whether it is WinXP or Win7.

Denis

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-12 Thread Keith Christian
Denis,

If Excel is starting a macro in the worksheet, it might be worth
adding some logging to the visual basic code.  Perhaps try this in
your Excel macro code if that is where the processing is taking place:



'--- Set up variables near the top of your macro.
'---   (Check whether you want the macro to set the current directory
(ChDir strPath) to that of the workbook.)
strPath = ThisWorkbook.Path
ChDir strPath
strLogFilename = strPath & "\" & "loggingfile.txt"


'--- Insert this block at various areas in the macro code
'--- Helps ensure logfile isn't discarded during a hang by
'---   using "Append" mode and flushing/closing immediately after
messages is written.
Open strLogFilename For Append As #2
strLogMessage = Now & "  " & "Current directory is " & strPath
Print #2, strLogMessage
Close #2



Keith


On Wed, Nov 12, 2014 at 9:20 AM, Kertz, Denis (D)** CTR **
 wrote:
>>> An excel program is run like this:
>>
>>> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>>
>>> When I run an Excel program interactively with this run.excel script it
>>> runs just fine but when I run it via a cron job Excel just hangs.
>>
>> Define "runs fine" please?
>> What exactly that excel script is doing?
>
> This run.excel script simply starts up Excel with the .xls file it is given.  
> In this example Excel opens c:\Shared\Bin\Create_Daily_Scorecard.xls.  This 
> .xls has a Workbook_Open macro, which is automatically run whenever this .xls 
> is opened, that reads some data files and creates another .xls as its output.
>
> What I mean by runs fine is that when I type this command at a bash prompt:
> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
> it runs to completion and creates a new .xls as its output.  When I run this 
> run.excel script from a cron job it hangs.
>
>>> When Excel hangs I can look at the processes running on the PC using the
>>> Windows Task Manager and I don't see the EXCEL.EXE process.  But when I
>>> check the option to show processes from all users I see the hung EXCEL.EXE
>>> process, AND the user name displayed is my login.  So I am running this 
>>> under the
>>> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
>>> but when I check 'Show processes from all users' it shows EXCEL.EXE running
>>> under user name Upar2 - a contradiction.
>>
>> Task manager display processes started in your current session.
>> Not processes started under your credentials. That's an important difference.
>
> Then this is just a difference between WinXP and Win7?  Under WinXP it shows 
> EXCEL.EXE in my process list even when the "Show processes from all users" 
> isn't checked.
>
>>> What I suspect is happening is Excel is attempting to do something that
>>> requires Upar2 permission but it isn't really running as Upar2 so Excel
>>> displays some error message and is waiting for the user to respond.  But
>>> Excel is running invisibly so this can't be seen.
>>
>> More like you expect to run Excel interactively from service.
>> Not possible. Period.
>
> I'm not trying to run Excel interactively from a cron job.  One of the 
> limitations with using Excel from a cron job is Excel has to run error free.  
> If Excel does run into some error it will typically generate an error message 
> and wait for a user response.  Since Excel is running invisibly from a cron 
> job, there is no user to give a response and Excel just sits there waiting 
> for a response that will never come.
>
>>> I also suspect this Upar2 "confusion" isn't limited to running an Excel
>>> program.  I can run a cron job with regular UNIX commands (cut, sort, etc)
>>> and see they are running with the ps command.  But when I try to kill them
>>> (kill -9) I get permission denied.  If I want to kill a process running via
>>> the cron I have to start cygwin with 'Run as administrator' and then I can
>>> kill processes running under the cron.
>>
>> Of course.
>
> Why "of course"?  Shouldn't I be able to kill my own processes?  I can 
> certainly do that under WinXP.  But this isn't a major issue for me.  I only 
> pointed it out in case it was related to the issue why my Excel cron jobs 
> hang.
>
> --
>> WBR,
>> Andrey Repin (anrdae...@yandex.ru) 11.11.2014, <22:14>
>>
>> Sorry for my terrible english...
>
> Nothing wrong with your English...
>
> Denis
>
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-12 Thread Andrey Repin
Greetings, Kertz, Denis (D)** CTR **!

>>> An excel program is run like this:
>>
>>> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>>
>>> When I run an Excel program interactively with this run.excel script it
>>> runs just fine but when I run it via a cron job Excel just hangs.
>>
>> Define "runs fine" please?
>> What exactly that excel script is doing?

> This run.excel script simply starts up Excel with the .xls file it is
> given.  In this example Excel opens
> c:\Shared\Bin\Create_Daily_Scorecard.xls.  This .xls has a Workbook_Open
> macro, which is automatically run whenever this .xls is opened, that reads
> some data files and creates another .xls as its output.

> What I mean by runs fine is that when I type this command at a bash prompt:
> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
> it runs to completion and creates a new .xls as its output.  When I run
> this run.excel script from a cron job it hangs.

Hangs as in - do not create new file?

>>> When Excel hangs I can look at the processes running on the PC using the
>>> Windows Task Manager and I don't see the EXCEL.EXE process.  But when I
>>> check the option to show processes from all users I see the hung EXCEL.EXE
>>> process, AND the user name displayed is my login.  So I am running this 
>>> under the
>>> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
>>> but when I check 'Show processes from all users' it shows EXCEL.EXE running
>>> under user name Upar2 - a contradiction.
>>
>> Task manager display processes started in your current session.
>> Not processes started under your credentials. That's an important difference.

> Then this is just a difference between WinXP and Win7?

It was the case in Vista already.

> Under WinXP it shows EXCEL.EXE in my process list even when the "Show
> processes from all users" isn't checked.

Only if you logged in as admin.

>>> What I suspect is happening is Excel is attempting to do something that
>>> requires Upar2 permission but it isn't really running as Upar2 so Excel
>>> displays some error message and is waiting for the user to respond.  But
>>> Excel is running invisibly so this can't be seen.
>>
>> More like you expect to run Excel interactively from service.
>> Not possible. Period.

> I'm not trying to run Excel interactively from a cron job.  One of the
> limitations with using Excel from a cron job is Excel has to run error free.
> If Excel does run into some error it will typically generate an error
> message and wait for a user response.  Since Excel is running invisibly from
> a cron job, there is no user to give a response and Excel just sits there
> waiting for a response that will never come.

Try starting cron in terminal session and see if anything comes up.

>>> I also suspect this Upar2 "confusion" isn't limited to running an Excel
>>> program.  I can run a cron job with regular UNIX commands (cut, sort, etc)
>>> and see they are running with the ps command.  But when I try to kill them
>>> (kill -9) I get permission denied.  If I want to kill a process running via
>>> the cron I have to start cygwin with 'Run as administrator' and then I can
>>> kill processes running under the cron.
>>
>> Of course.

> Why "of course"?  Shouldn't I be able to kill my own processes?

It's not "your own" process, it's "cron job" started with your credentials.

> I can certainly do that under WinXP.

Again, only if you logged in as admin.
This is not the case in Vista+ by default.

> But this isn't a major issue for me.  I only
> pointed it out in case it was related to the issue why my Excel cron jobs 
> hang.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 12.11.2014, <23:08>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-12 Thread Kertz, Denis (D)** CTR **
>> An excel program is run like this:
>
>> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>
>> When I run an Excel program interactively with this run.excel script it
>> runs just fine but when I run it via a cron job Excel just hangs.
>
> Define "runs fine" please?
> What exactly that excel script is doing?

This run.excel script simply starts up Excel with the .xls file it is given.  
In this example Excel opens c:\Shared\Bin\Create_Daily_Scorecard.xls.  This 
.xls has a Workbook_Open macro, which is automatically run whenever this .xls 
is opened, that reads some data files and creates another .xls as its output.

What I mean by runs fine is that when I type this command at a bash prompt:
run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'
it runs to completion and creates a new .xls as its output.  When I run this 
run.excel script from a cron job it hangs.

>> When Excel hangs I can look at the processes running on the PC using the
>> Windows Task Manager and I don't see the EXCEL.EXE process.  But when I
>> check the option to show processes from all users I see the hung EXCEL.EXE
>> process, AND the user name displayed is my login.  So I am running this 
>> under the
>> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
>> but when I check 'Show processes from all users' it shows EXCEL.EXE running
>> under user name Upar2 - a contradiction.
>
> Task manager display processes started in your current session.
> Not processes started under your credentials. That's an important difference.

Then this is just a difference between WinXP and Win7?  Under WinXP it shows 
EXCEL.EXE in my process list even when the "Show processes from all users" 
isn't checked.

>> What I suspect is happening is Excel is attempting to do something that
>> requires Upar2 permission but it isn't really running as Upar2 so Excel
>> displays some error message and is waiting for the user to respond.  But
>> Excel is running invisibly so this can't be seen.
>
> More like you expect to run Excel interactively from service.
> Not possible. Period.

I'm not trying to run Excel interactively from a cron job.  One of the 
limitations with using Excel from a cron job is Excel has to run error free.  
If Excel does run into some error it will typically generate an error message 
and wait for a user response.  Since Excel is running invisibly from a cron 
job, there is no user to give a response and Excel just sits there waiting for 
a response that will never come.

>> I also suspect this Upar2 "confusion" isn't limited to running an Excel
>> program.  I can run a cron job with regular UNIX commands (cut, sort, etc)
>> and see they are running with the ps command.  But when I try to kill them
>> (kill -9) I get permission denied.  If I want to kill a process running via
>> the cron I have to start cygwin with 'Run as administrator' and then I can
>> kill processes running under the cron.
>
> Of course.

Why "of course"?  Shouldn't I be able to kill my own processes?  I can 
certainly do that under WinXP.  But this isn't a major issue for me.  I only 
pointed it out in case it was related to the issue why my Excel cron jobs hang.

--
> WBR,
> Andrey Repin (anrdae...@yandex.ru) 11.11.2014, <22:14>
>
> Sorry for my terrible english...

Nothing wrong with your English...

Denis


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Can't Run Excel From A Cron Job Under Windows 7

2014-11-11 Thread Andrey Repin
Greetings, Kertz, Denis (D)** CTR **!

> I am trying to port a cygwin application that uses cron from a WinXP PC to
> a Win7 Pro PC and I find some cron jobs won't run.  Specifically, I need to
> run an Excel program from a cron job and this doesn't work on my Win7 PC.

> In order to run an Excel program from cygwin I have this run.excel bash
> script with an embedded VB script that executes an Excel program:

> excel=$1
> vbscript=/usr/tmp/$$.vbs
> cat <<-! >$vbscript
> Dim xlApp
> Set xlApp = CreateObject("Excel.application")
> Set xlWb = xlApp.workbooks.Open("$excel")
> xlApp.Quit
> Set xlWb = Nothing
> Set xlApp = Nothing
> !
> chmod 777  $vbscript
> c:/Windows/System32/wscript.exe  'c:\cygwin64\usr\tmp\$$.vbs'

> An excel program is run like this:

> run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'

> When I run an Excel program interactively with this run.excel script it
> runs just fine but when I run it via a cron job Excel just hangs.

Define "runs fine" please?
What exactly that excel script is doing?

> When Excel hangs I can look at the processes running on the PC using the
> Windows Task Manager and I don't see the EXCEL.EXE process.  But when I
> check the option to show processes from all users I see the hung EXCEL.EXE
> process, AND the user name displayed is my login.  So I am running this under 
> the
> Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process
> but when I check 'Show processes from all users' it shows EXCEL.EXE running
> under user name Upar2 - a contradiction.

Task manager display processes started in your current session.
Not processes started under your credentials. That's an important difference.

> What I suspect is happening is Excel is attempting to do something that
> requires Upar2 permission but it isn't really running as Upar2 so Excel
> displays some error message and is waiting for the user to respond.  But
> Excel is running invisibly so this can't be seen.

More like you expect to run Excel interactively from service.
Not possible. Period.

> I also suspect this Upar2 "confusion" isn't limited to running an Excel
> program.  I can run a cron job with regular UNIX commands (cut, sort, etc)
> and see they are running with the ps command.  But when I try to kill them
> (kill -9) I get permission denied.  If I want to kill a process running via
> the cron I have to start cygwin with 'Run as administrator' and then I can
> kill processes running under the cron.

Of course.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 11.11.2014, <22:14>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Can't Run Excel From A Cron Job Under Windows 7

2014-11-11 Thread Kertz, Denis (D)** CTR **
I am trying to port a cygwin application that uses cron from a WinXP PC to a 
Win7 Pro PC and I find some cron jobs won't run.  Specifically, I need to run 
an Excel program from a cron job and this doesn't work on my Win7 PC.

In order to run an Excel program from cygwin I have this run.excel bash script 
with an embedded VB script that executes an Excel program:

excel=$1
vbscript=/usr/tmp/$$.vbs
cat <<-! >$vbscript
Dim xlApp
Set xlApp = CreateObject("Excel.application")
Set xlWb = xlApp.workbooks.Open("$excel")
xlApp.Quit
Set xlWb = Nothing
Set xlApp = Nothing
!
chmod 777  $vbscript
c:/Windows/System32/wscript.exe  'c:\cygwin64\usr\tmp\$$.vbs'

An excel program is run like this:

run.excel  'c:\Shared\Bin\Create_Daily_Scorecard.xls'

When I run an Excel program interactively with this run.excel script it runs 
just fine but when I run it via a cron job Excel just hangs.  When Excel hangs 
I can look at the processes running on the PC using the Windows Task Manager 
and I don't see the EXCEL.EXE process.  But when I check the option to show 
processes from all users I see the hung EXCEL.EXE process, AND the user name 
displayed is my login.  So I am running this under the Upar2 login and Task 
Manager doesn't display EXCEL.EXE as a Upar2 process but when I check 'Show 
processes from all users' it shows EXCEL.EXE running under user name Upar2 - a 
contradiction.

What I suspect is happening is Excel is attempting to do something that 
requires Upar2 permission but it isn't really running as Upar2 so Excel 
displays some error message and is waiting for the user to respond.  But Excel 
is running invisibly so this can't be seen.

I also suspect this Upar2 "confusion" isn't limited to running an Excel 
program.  I can run a cron job with regular UNIX commands (cut, sort, etc) and 
see they are running with the ps command.  But when I try to kill them (kill 
-9) I get permission denied.  If I want to kill a process running via the cron 
I have to start cygwin with 'Run as administrator' and then I can kill 
processes running under the cron.

So, does anyone know what's going on here and what I need to do get these cron 
jobs running.  As I noted at the beginning this is being ported from WinXP, 
where all this works fine, to Win7.

I set up cron using cron-config like this:

$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ]

Do you want the cron daemon to run as yourself? (yes/no) yes

Please enter the password for user 'Upar2':
Reenter:
Running cron_diagnose ...
... 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.

Denis


cygcheck.out
Description: cygcheck.out
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple

Re: Problem with cron jobs

2014-08-21 Thread Duncan Roe
On Thu, Aug 21, 2014 at 07:59:29AM -0400, Cary Lewis wrote:
> I have created a small shell script that acts like a network
> connectivity watchdog, which checks for a successful ping to the
> internet, and if it doesn't work, restarts the machine.
>
> When I attempt to run it from a cron job, the script exits whenever
> any of the commands exits with a non zero status, preventing the
> script from doing its job.
>
> Has anyone seen this behaviour before?
>
Yes - this is the behaviour you get with "set -e". To negate it, put "set +e"
at the top of your script,

Cheers ... Duncan.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Problem with cron jobs

2014-08-21 Thread Andrew DeFaria

On 8/21/2014 7:25 AM, Andrey Repin wrote:

Greetings, Cary Lewis!


I have created a small shell script that acts like a network
connectivity watchdog, which checks for a successful ping to the
internet, and if it doesn't work, restarts the machine.



When I attempt to run it from a cron job, the script exits whenever
any of the commands exits with a non zero status, preventing the
script from doing its job.



Has anyone seen this behaviour before?



I have tried wrapping the script in () to run it within a sub-shell,
but to no avail.


man bash
You have to disable abort-on-error in your script.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 21.08.2014, <18:24>

Sorry for my terrible english...




$ man bash | grep abort
   Control-G  will  abort  an  incremental search and restore the 
original

   abort (C-g)

It might be better if your searched for "errexit".

--
Andrew DeFaria
http://defaria.com


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Problem with cron jobs

2014-08-21 Thread Andrey Repin
Greetings, Cary Lewis!

> I have created a small shell script that acts like a network
> connectivity watchdog, which checks for a successful ping to the
> internet, and if it doesn't work, restarts the machine.

> When I attempt to run it from a cron job, the script exits whenever
> any of the commands exits with a non zero status, preventing the
> script from doing its job.

> Has anyone seen this behaviour before?

> I have tried wrapping the script in () to run it within a sub-shell,
> but to no avail.

man bash
You have to disable abort-on-error in your script.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 21.08.2014, <18:24>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Problem with cron jobs

2014-08-21 Thread Cary Lewis
I have created a small shell script that acts like a network
connectivity watchdog, which checks for a successful ping to the
internet, and if it doesn't work, restarts the machine.

When I attempt to run it from a cron job, the script exits whenever
any of the commands exits with a non zero status, preventing the
script from doing its job.

Has anyone seen this behaviour before?

I have tried wrapping the script in () to run it within a sub-shell,
but to no avail.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Unable to get cygwin cron to work

2014-08-18 Thread Pierre A. Humblet
> -Original Message-
> From: cygwin-owne at cygwin.com on Behalf Of Denis
> Sent: Friday, August 15, 2014 21:39
> 
> I'm trying unsuccesfully to get cron to work under 64-bit cywin under Win7
> Pro.  First, I tried running as myself (running cygwin with system
> administrator privilege):
> 
> $ cron-config
> Do you want to install the cron daemon as a service? (yes/no) yes Enter
the
> value of CYGWIN for the daemon: [ ]
> 
> Do you want the cron daemon to run as yourself? (yes/no) yes
> 
> WARNING: User dkertz appears 2 times in /etc/passwd.
> This may confuse the system
> Edit /etc/passwd and assign unique user ids.
> 


> From the above you can see the warning about my login appearing twice in
> /etc/passwd:
> 
> $ grep dkertz /etc/passwd
> dkertz:unused:1003:513:dkertz,U-USNAVN0D011H46\dkertz,
> S-1-5-21-2470246883-414681431-158823764-1003:/home/dkertz:/bin/bash
> dkertz:unused:295587:10513:U-NA02\dkertz,
> S-1-5-21-2112754840-354624142-596004286-
> 285587:/home/dkertz:/bin/bash
> 
> USNAVN0D011H46 is the PC machine name and NA02 is the domain set up by
> corporate IT.  Does this suggest IT has messed up?  I log into the PC
using the
> na02\dkertz login.
> 
> Thinking this login duplication might be the problem, I changed
/etc/passwd
> to contain only the first login and then only the second login with the
same
> results - logon failure when running cron-config.
> 

> 
> Now the cron runs but a scheduled cron job doesn't run and this is what
the
> cronevents shows:
> 
> 2014/08/15 19:41:01 [SYSTEM] /usr/sbin/cron: PID 4692: (dkertz) WRONG
> FILE OWNER (tabs/dkertz)
> 

There is no doubt that your problems are caused by the duplicate entry.
There is no enough info to explain everything but note that according to
http://cygwin.com/ml/cygwin/2014-02/msg00306.html
when an entry can't be found in /etc/passwd it is now autogenerated.

So I suggest that you try the following to sort things out better:
- restore the original /etc/passwd with the 2 dkertz
- manually edit /etc/passwd and rename one of them, for example one of them
to NA02_dkertz
- if you have renamed the dkertz you have login with, log out of Cygwin and
start a new shell
- make sure the crontab in /var/cron/tabs/ has the name of and is owned by
the dkertz you want, and is readable by administrators
- try starting cron again. If starting as yourself, make sure you are the
one who owns the crontab.
Sorry I can't help more, but I don' have a 64 bit system nor easy access to
a domain account and I have not kept track with the way Cygwin maps user
names.

Pierre

 


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Unable to get cygwin cron to work

2014-08-15 Thread Denis
I'm trying unsuccesfully to get cron to work under 64-bit cywin under Win7
Pro.  First, I tried running as myself (running cygwin with system
administrator privilege):

$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ]

Do you want the cron daemon to run as yourself? (yes/no) yes

WARNING: User dkertz appears 2 times in /etc/passwd.
This may confuse the system
Edit /etc/passwd and assign unique user ids.

Please enter the password for user 'dkertz':
Reenter:
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
cygrunsrv: Error starting a service: StartService:  Win32 error 1069:
The service did not start due to a logon failure.

>From the above you can see the warning about my login appearing twice in
/etc/passwd:

$ grep dkertz /etc/passwd
dkertz:unused:1003:513:dkertz,U-USNAVN0D011H46\dkertz,
S-1-5-21-2470246883-414681431-158823764-1003:/home/dkertz:/bin/bash
dkertz:unused:295587:10513:U-NA02\dkertz,
S-1-5-21-2112754840-354624142-596004286-285587:/home/dkertz:/bin/bash

USNAVN0D011H46 is the PC machine name and NA02 is the domain set up by
corporate IT.  Does this suggest IT has messed up?  I log into the PC using
the na02\dkertz login.

Thinking this login duplication might be the problem, I changed /etc/passwd
to contain only the first login and then only the second login with the same
results - logon failure when running cron-config.


Next, I decided to try running cron under the password -R option:

First, I ran the /usr/bin/cygserver-config and verified the service was
running using services.msc.  Then I ran password -R.  The the cron config:

$ cron-config
Cron is already installed as a service under account .\cyg_server.
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: [ ]

You must decide under what account the cron daemon will run.

Do you want the cron daemon to run as yourself? (yes/no) no
Were the passwords of all cron users saved with "passwd -R", or
are you using the cyglsa package ? (yes/no) yes

The cron daemon will run as SYSTEM.

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

Now the cron runs but a scheduled cron job doesn't run and this is what the
cronevents shows:

2014/08/15 19:41:01 [SYSTEM] /usr/sbin/cron: PID 4692: (dkertz) WRONG FILE
OWNER (tabs/dkertz)

-

Anybody have any suggestions or advice?  Could the problem be that corporate
IT has somehow messed up the PC, as the duplicate login in /etc/passwd might
be the case.

Denis




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: wget-1.15-1 vx wget-1.13-4, LANG and cron

2014-05-13 Thread Eric Blake
On 05/13/2014 03:49 PM, First Last wrote:
> I had trouble when I updated to wget-1.15-1.
> 
> I have a cron script that grabs a camera picture using
> wget.  It failed with the new wget-1.15-1.
> 
> 1) wget stderr has a line:
>  Saving to: 'filename'
> 
> In wget-1.13.4-1 the delimiter before the filename is a
> backtick and after the filename there is a single quote.

Yes, this was an intentional change upstream (many GNU projects have
been ditching `' quoting in favor of '' quoting, ever since GNU Coding
Standards were changed in light of modern typography looking ugly
compared to the way it looked 30 years ago when GNU first championed `').

> Also if the URL contains a  the filename has
> a .
> 
> In wget-1.15-1 both delimiters are single quotes, at
> least with LANG=C.  A space in the URL results in
> a "%20" in the filename.

Nothing here is cygwin-specific, as I just built wget from stock
upstream.  You'll get better response if you take your issues upstream,
since I suspect they are reproducible on Linux.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


wget-1.15-1 vx wget-1.13-4, LANG and cron

2014-05-13 Thread First Last
I had trouble when I updated to wget-1.15-1.

I have a cron script that grabs a camera picture using
wget.  It failed with the new wget-1.15-1.

1) wget stderr has a line:
 Saving to: 'filename'

In wget-1.13.4-1 the delimiter before the filename is a
backtick and after the filename there is a single quote.
Also if the URL contains a  the filename has
a .

In wget-1.15-1 both delimiters are single quotes, at
least with LANG=C.  A space in the URL results in
a "%20" in the filename.


2) wget-1.15-1 is more sensitive to LANG etc.

When I ran the repaired script from bash it worked fine,
but under cron without setting LC_ALL or LANG the
wget-1.15-1 stderr output filename delimiters were wide
characters.

Setting
   export LC_ALL=C LC_CTYPE=C LANG=C
at the top of the cron script returned the single quote
delimiters.  Working fine now.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cron isnt running, switched from 64bit to 32

2014-01-19 Thread Larry Hall (Cygwin)

On 1/16/2014 8:05 PM, patrick wrote:

hi,

i had cron running from a 64bit cygwin install, but i decided to switch to a
32bit version.
the 32bit cygwin is installed to a differnt directory.

what i did:
running cron-config again from a terminal started as admin.
deinstalling the service via cygrunsrv -R cron and reinstalling via cron-config

both didnt work. the system is probably looking at a path from the old
install somewhere.

couldnt get usefull info from the windows event log, just some standard
yaddayadda

any ideas how to fix this?


Well, the service hasn't been installed.  Perhaps you should start the
elevated terminal again and type 'set -x' before running cron-config to
see if there's anything interesting output when you run it.


--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



cron isnt running, switched from 64bit to 32

2014-01-17 Thread patrick

hi,

i had cron running from a 64bit cygwin install, but i decided to switch 
to a 32bit version.

the 32bit cygwin is installed to a differnt directory.

what i did:
running cron-config again from a terminal started as admin.
deinstalling the service via cygrunsrv -R cron and reinstalling via 
cron-config


both didnt work. the system is probably looking at a path from the old 
install somewhere.


couldnt get usefull info from the windows event log, just some standard 
yaddayadda


any ideas how to fix this?


heres the cronbug output:
Current version
-rwxr-xr-x 1 14354s None 5304 Feb 16  2010 
/usr/share/doc/Cygwin/cron-4.1-59.README


Running crons:
 315243483152   4140  pty01000 23:17:08 
/usr/bin/crontab


Sendmail:
lrwxrwxrwx 1 14354s None 16 Jan 14 01:16 /usr/sbin/sendmail -> 
/usr/bin/cronlog


Crontabs:
-rw-r- 1 14354s root 270 Jan 17 01:50 /var/cron/tabs/14354s
-rw-r- 1 1000 0 270 Jan 17 01:50 /var/cron/tabs/14354s

cron.log:

cron.pid:

Crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.pdQJK4zg9U installed on Fri Jan 17 01:50:30 2014)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie 
Exp $)

51 01 * * * ping yellowstone
0 */6 * * * bash ~/bin/rsync-backup.sh

Windows Application Events log:
2013/12/20 01:46:13 [14354s] crontab: PID 8320: (14354s) BEGIN EDIT (14354s)
2013/12/20 01:46:15 [14354s] crontab: PID 8320: (14354s) END EDIT (14354s)
2013/12/21 01:18:24 [14354s] crontab: PID 12892: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:18:54 [14354s] crontab: PID 12892: (14354s) END EDIT (14354s)
2013/12/21 01:18:56 [14354s] crontab: PID 14148: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:18:59 [14354s] crontab: PID 14148: (14354s) END EDIT (14354s)
2013/12/21 01:21:13 [14354s] crontab: PID 11532: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:21:18 [14354s] crontab: PID 11532: (14354s) END EDIT (14354s)
2013/12/21 01:23:48 [14354s] crontab: PID 6320: (14354s) BEGIN EDIT (14354s)
2013/12/21 01:24:04 [14354s] crontab: PID 6320: (14354s) REPLACE (14354s)
2013/12/21 01:24:04 [14354s] crontab: PID 6320: (14354s) END EDIT (14354s)
2013/12/21 01:25:32 [14354s] crontab: PID 12696: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:22 [14354s] crontab: PID 12696: (14354s) REPLACE (14354s)
2013/12/21 01:28:22 [14354s] crontab: PID 12696: (14354s) END EDIT (14354s)
2013/12/21 01:28:24 [14354s] crontab: PID 11852: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:32 [14354s] crontab: PID 11852: (14354s) END EDIT (14354s)
2013/12/21 01:28:47 [14354s] crontab: PID 12768: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:58 [14354s] crontab: PID 12768: (14354s) REPLACE (14354s)
2013/12/21 01:28:58 [14354s] crontab: PID 12768: (14354s) END EDIT (14354s)
2013/12/21 01:30:06 [14354s] crontab: PID 11240: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:30:43 [14354s] crontab: PID 11240: (14354s) END EDIT (14354s)
2013/12/21 01:31:36 [SYSTEM] cron: PID 13504: `cron' service stopped, 
exit status: 1
2013/12/21 01:38:13 [14354s] /usr/sbin/cron: PID 11056: (CRON) STARTUP 
(V5.0)

2013/12/21 01:38:14 [14354s] cron: PID 13832: `cron' service started
2013/12/21 01:38:37 [14354s] crontab: PID 14036: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:38:38 [14354s] crontab: PID 14036: (14354s) REPLACE (14354s)
2013/12/21 01:38:38 [14354s] crontab: PID 14036: (14354s) END EDIT (14354s)
2013/12/21 01:39:01 [14354s] /usr/sbin/cron: PID 11056: (14354s) RELOAD 
(tabs/14354s)
2013/12/21 01:39:01 [14354s] /usr/sbin/cron: PID 7876: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:40:01 [14354s] /usr/sbin/cron: PID 12264: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:41:01 [14354s] /usr/sbin/cron: PID 13024: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:42:01 [14354s] /usr/sbin/cron: PID 13880: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:43:01 [14354s] /usr/sbin/cron: PID 12324: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:44:01 [14354s] /usr/sbin/cron: PID 9428: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:45:01 [14354s] /usr/sbin/cron: PID 12108: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:46:01 [14354s] /usr/sbin/cron: PID 12308: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:47:01 [14354s] /usr/sbin/cron: PID 11200: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:48:01 [14354s] /usr/sbin/cron: PID 13068: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:49:01 [14354s] /usr/sbin/cron: PID 12524: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:50:01 [14354s] /usr/sbin/cron: PID 12760: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:51:01 [14354s] /usr/sbin/cron: PID 13252: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:52:01 [14354s] /usr/sbin/cron: PID 11496: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:53:01 [14354s] /usr/sbin/cron: PID 14288: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:54:01 [14354s] /usr/sbin/cron: PID 13300: (14354s) CM

cron isnt running, switched from 64bit to 32

2014-01-16 Thread patrick

hi,

i had cron running from a 64bit cygwin install, but i decided to switch 
to a 32bit version.

the 32bit cygwin is installed to a differnt directory.

what i did:
running cron-config again from a terminal started as admin.
deinstalling the service via cygrunsrv -R cron and reinstalling via 
cron-config


both didnt work. the system is probably looking at a path from the old 
install somewhere.


couldnt get usefull info from the windows event log, just some standard 
yaddayadda


any ideas how to fix this?


heres the cronbug output:
Current version
-rwxr-xr-x 1 14354s None 5304 Feb 16  2010 
/usr/share/doc/Cygwin/cron-4.1-59.README


Running crons:
 315243483152   4140  pty01000 23:17:08 
/usr/bin/crontab


Sendmail:
lrwxrwxrwx 1 14354s None 16 Jan 14 01:16 /usr/sbin/sendmail -> 
/usr/bin/cronlog


Crontabs:
-rw-r- 1 14354s root 270 Jan 17 01:50 /var/cron/tabs/14354s
-rw-r- 1 1000 0 270 Jan 17 01:50 /var/cron/tabs/14354s

cron.log:

cron.pid:

Crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.pdQJK4zg9U installed on Fri Jan 17 01:50:30 2014)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie 
Exp $)

51 01 * * * ping yellowstone
0 */6 * * * bash ~/bin/rsync-backup.sh

Windows Application Events log:
2013/12/20 01:46:13 [14354s] crontab: PID 8320: (14354s) BEGIN EDIT (14354s)
2013/12/20 01:46:15 [14354s] crontab: PID 8320: (14354s) END EDIT (14354s)
2013/12/21 01:18:24 [14354s] crontab: PID 12892: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:18:54 [14354s] crontab: PID 12892: (14354s) END EDIT (14354s)
2013/12/21 01:18:56 [14354s] crontab: PID 14148: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:18:59 [14354s] crontab: PID 14148: (14354s) END EDIT (14354s)
2013/12/21 01:21:13 [14354s] crontab: PID 11532: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:21:18 [14354s] crontab: PID 11532: (14354s) END EDIT (14354s)
2013/12/21 01:23:48 [14354s] crontab: PID 6320: (14354s) BEGIN EDIT (14354s)
2013/12/21 01:24:04 [14354s] crontab: PID 6320: (14354s) REPLACE (14354s)
2013/12/21 01:24:04 [14354s] crontab: PID 6320: (14354s) END EDIT (14354s)
2013/12/21 01:25:32 [14354s] crontab: PID 12696: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:22 [14354s] crontab: PID 12696: (14354s) REPLACE (14354s)
2013/12/21 01:28:22 [14354s] crontab: PID 12696: (14354s) END EDIT (14354s)
2013/12/21 01:28:24 [14354s] crontab: PID 11852: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:32 [14354s] crontab: PID 11852: (14354s) END EDIT (14354s)
2013/12/21 01:28:47 [14354s] crontab: PID 12768: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:28:58 [14354s] crontab: PID 12768: (14354s) REPLACE (14354s)
2013/12/21 01:28:58 [14354s] crontab: PID 12768: (14354s) END EDIT (14354s)
2013/12/21 01:30:06 [14354s] crontab: PID 11240: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:30:43 [14354s] crontab: PID 11240: (14354s) END EDIT (14354s)
2013/12/21 01:31:36 [SYSTEM] cron: PID 13504: `cron' service stopped, 
exit status: 1
2013/12/21 01:38:13 [14354s] /usr/sbin/cron: PID 11056: (CRON) STARTUP 
(V5.0)

2013/12/21 01:38:14 [14354s] cron: PID 13832: `cron' service started
2013/12/21 01:38:37 [14354s] crontab: PID 14036: (14354s) BEGIN EDIT 
(14354s)

2013/12/21 01:38:38 [14354s] crontab: PID 14036: (14354s) REPLACE (14354s)
2013/12/21 01:38:38 [14354s] crontab: PID 14036: (14354s) END EDIT (14354s)
2013/12/21 01:39:01 [14354s] /usr/sbin/cron: PID 11056: (14354s) RELOAD 
(tabs/14354s)
2013/12/21 01:39:01 [14354s] /usr/sbin/cron: PID 7876: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:40:01 [14354s] /usr/sbin/cron: PID 12264: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:41:01 [14354s] /usr/sbin/cron: PID 13024: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:42:01 [14354s] /usr/sbin/cron: PID 13880: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:43:01 [14354s] /usr/sbin/cron: PID 12324: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:44:01 [14354s] /usr/sbin/cron: PID 9428: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:45:01 [14354s] /usr/sbin/cron: PID 12108: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:46:01 [14354s] /usr/sbin/cron: PID 12308: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:47:01 [14354s] /usr/sbin/cron: PID 11200: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:48:01 [14354s] /usr/sbin/cron: PID 13068: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:49:01 [14354s] /usr/sbin/cron: PID 12524: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:50:01 [14354s] /usr/sbin/cron: PID 12760: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:51:01 [14354s] /usr/sbin/cron: PID 13252: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:52:01 [14354s] /usr/sbin/cron: PID 11496: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:53:01 [14354s] /usr/sbin/cron: PID 14288: (14354s) CMD 
(ping -n 3 192.168.11.81)
2013/12/21 01:54:01 [14354s] /usr/sbin/cron: PID 13300: (14354s) CM

Re: Confused about several issues with setting up cron

2013-09-24 Thread bartels

On 09/24/2013 08:13 PM, KARR, DAVID wrote:

15   31593 [main] crontab 8612 fhandler_base::open_fs: 0 = 
fhandler_disk_file::open(\??\C:\Cygwin\var\cron\tabs\dk068x, 0x8000)
21   31614 [main] crontab 8612 open: -1 = open(tabs/dk068x, 0x8000), errno 2



There you go: the process has no write access to your crontab file 
(C:\Cygwin\var\cron\tabs\dk068x)

Popular advice on this list is that you do not mix posix and windoze 
permissions.
I have fallen into that trap myself.

- bartels

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-24 Thread Steve
I would try the following methods:

First make sure you are launching your local terminal with "Runas
Administrator" checked, even if you are the Administrator user. I am
also asuming you have done the normal stuff like cygcheck -c, and make
sure you have not loaded duplicate dlls during your troubleshooting.
If you ever get resource fork issues with parent != child error
messages right in the term, that needs to be fixed by removing the
duplicate dll file. And run /bin/rebaseall from dash or ash terminals
(disable Anti-viri).
Always manually right click and Run mintty as Administrator, also try
changing the path in the mintty shortcut to
c:\cygwin\bin\mintty.exe -
% cygrunsrv -R cron
reboot to be on the safe side
After bootup use cygwin setup to uninstall cron, then run setup again
and install it.
% cron-config
You shouldn't need todo anything custom here, yes and defaults to
everything. It should be using your current user account, and that is
hopefully the full fledged Administrator account, and not some other
user with admin privs. Which also means you are currently logged into
windows as the full Administrator account.
% net start cron
% EDITOR=vi
or whatev
% crontab -e
create an entry that just fires of something basic very frequently for instance
*/1  * * * * echo "this" > /cygdrive/c/Users/
Administrator/Desktop/test.file.txt
You many also want to throw in the PATH into the crontab itself for example:
PATH=/bin:/usr/bin:/usr/local/bin
As alternative to or in addition to the mentioned test.file.txt
creation cron entry, you could use something like this:
@reboot echo "this" > /cygdrive/c/Users/Administrator/Desktop/test.file.txt
So that instead of something fireing off every minute for testing, it
would fire it off each time you stop/start the cron service with "net
stop cron" and "net start cron"

Sorry for the messy response, i have no time right now. Good luck
reading this email and getting it working.  :)

On Sat, Sep 21, 2013 at 6:00 PM, KARR, DAVID  wrote:
> CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin
>
> I want to set up a cron job, so I have to get cron configured.  I'm trying to 
> follow the instructions I can find, but I'm seeing several issues.
>
> I'm surprised that there's nothing in the user guide or the FAQ about setting 
> up cron.  I had to settle for the various questions about this on 
> StackOverflow and others.
>
> I must have done something at least half correct, because I believe this 
> tells me that cron is running:
>
> % cygrunsrv -L
> cron
>
> % cronevents
> 2013/09/20 21:14:06 [dk068x] crontab: PID 5924: (dk068x) LIST (dk068x)
> 2013/09/21 11:28:15 [dk068x] /usr/sbin/cron: PID 4980: (CRON) STARTUP (V5.0)
> 2013/09/21 11:28:16 [dk068x] cron: PID 8424: `cron' service started
>
> However, I then do "crontab ", where 
> "pathtomycrontabfile" is the path to my crontab file with the job I want to 
> run.  I then do "crontab -l" and it prints nothing.  There is nothing in 
> "/var/log/cron*".
>
> I did get some errors when I ran "cron-config", but I unfortunately lost that 
> output.
>
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-24 Thread bartels

On 09/24/2013 05:04 PM, KARR, DAVID wrote:

-Original Message-
From: KARR, DAVID
Sent: Sunday, September 22, 2013 2:32 PM
Subject: RE: Confused about several issues with setting up cron


-Original Message-
Sent: Sunday, September 22, 2013 12:46 PM
Subject: Re: Confused about several issues with setting up cron

On 09/22/2013 05:56 PM, bartels wrote:

On 09/22/2013 03:00 AM, KARR, DAVID wrote:

CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

I want to set up a cron job, so I have to get cron configured. I'm

trying

to follow the instructions I can find, but I'm seeing several issues.

I'm surprised that there's nothing in the user guide or the FAQ about

setting up cron.  I had to settle for the various questions about this

on StackOverflow and others.

  >>> I want to set up a cron job, so I have to get cron configured.  I'm
trying
  >> to follow the instructions I can find, but I'm seeing several issues.
  >>> I'm surprised that there's nothing in the user guide or the FAQ about
  >> setting up cron.  I had to settle for the various questions about this

on

  >> StackOverflow and others.
  >>
  >> Must say your reporting of events is also lacking crucial elements
  >> If you re-install and give me more details, then I will try and answer
your
  >> questions.
  > Ok.  I assume you mean re-installing cron, not Cygwin.
Yes, cron-config is what I meant.
  >
  > I followed the process described in the FAQ for removing a service.  I
then ran cron-config again.  When I did this before, I selected to run
cron as myself.  I decided to make it run as the local system account this
time (first running "passwd -R" and entering my password).  It
appeared to complete without errors or warnings.  I did this in a "run as
administrator" window.
  >
  > In a normal window, I then ran "crontab -e".  I figured this would put

me

into "vi" with an empty buffer.  It just returned to the prompt.
You should see a vi session.
Do you have vi installed?
What is the value of EDITOR?

Yes, I have vi installed.  EDITOR was blank, but I tried setting it to "vi"
and repeating the test, with no change.


This could indicate a deeper problem, confusing not just cron.

  > I then ran "crontab crontab" (the "crontab" file in my current directory
is the file with the one job I want to run), and then did "crontab
-l".  Nothing.

Are you familiar with the crontab format? If not, try this:
$ man 5 crontab

Yes, I am familiar with it, but here's the crontab I'm trying to set, in any
case:

0 * * * *   monitorDataSource


  >
  > I then went back to the administrator window.  I ran "cronevents".  This
didn't show anything more than the cron service being started.  I
then ran "cronbug".  I'm attaching the gzipped copy of this.
  >
You will have more luck running cron 'as yourself': it is straightforward.
Running it as a privileged user is more complicated.

Is there a specific reason why you want to run it as system?

No, only because running it as myself didn't work.

In any case, I tried stopping and removing the service and rerunning cron-
config, running the service as myself.  It didn't make any difference.  No
response from "crontab -e", and "crontab crontab" seemingly ignored.  Nothing
in "/var/log/cron.log", and nothing in "cronevents" except for the service
stopping and starting.

Any more ideas about this?



I guess it is to do with privileges.
cron works on my machines without fail: as system, and as privileged user

If you look at the service
$ cygrunsrv.exe  -Q cron --verbose

You can see that you can run cron from your own account like this:
$  /usr/sbin/cron -n

Anyway, the cron process needs read/write access to
/var/cron/tabs/

No cron file there, means no cron jobs for you.

The fact that you do not get an editor with 'crontab -e' is strange.
I can only guess that EDITOR has a strange value, or crontab dies on privileges.

Have you tried strace?
$ strace -f crontab -e 2>&1 | tee strace.log

You can probably see it dying.

- bartels



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Confused about several issues with setting up cron

2013-09-24 Thread KARR, DAVID
> -Original Message-
> From: KARR, DAVID
> Sent: Sunday, September 22, 2013 2:32 PM
> Subject: RE: Confused about several issues with setting up cron
> 
> > -Original Message-
> > Sent: Sunday, September 22, 2013 12:46 PM
> > Subject: Re: Confused about several issues with setting up cron
> >
> > On 09/22/2013 05:56 PM, bartels wrote:
> > > On 09/22/2013 03:00 AM, KARR, DAVID wrote:
> > >> CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin
> > >>
> > >> I want to set up a cron job, so I have to get cron configured. I'm
> trying
> > to follow the instructions I can find, but I'm seeing several issues.
> > >>
> > >> I'm surprised that there's nothing in the user guide or the FAQ about
> > setting up cron.  I had to settle for the various questions about this
> > >> on StackOverflow and others.
> > >
> >  >>> I want to set up a cron job, so I have to get cron configured.  I'm
> > trying
> >  >> to follow the instructions I can find, but I'm seeing several issues.
> >  >>> I'm surprised that there's nothing in the user guide or the FAQ about
> >  >> setting up cron.  I had to settle for the various questions about this
> on
> >  >> StackOverflow and others.
> >  >>
> >  >> Must say your reporting of events is also lacking crucial elements
> >  >> If you re-install and give me more details, then I will try and answer
> > your
> >  >> questions.
> >  > Ok.  I assume you mean re-installing cron, not Cygwin.
> > Yes, cron-config is what I meant.
> >  >
> >  > I followed the process described in the FAQ for removing a service.  I
> > then ran cron-config again.  When I did this before, I selected to run
> > cron as myself.  I decided to make it run as the local system account this
> > time (first running "passwd -R" and entering my password).  It
> > appeared to complete without errors or warnings.  I did this in a "run as
> > administrator" window.
> >  >
> >  > In a normal window, I then ran "crontab -e".  I figured this would put
> me
> > into "vi" with an empty buffer.  It just returned to the prompt.
> > You should see a vi session.
> > Do you have vi installed?
> > What is the value of EDITOR?
> 
> Yes, I have vi installed.  EDITOR was blank, but I tried setting it to "vi"
> and repeating the test, with no change.
> 
> > This could indicate a deeper problem, confusing not just cron.
> >
> >  > I then ran "crontab crontab" (the "crontab" file in my current directory
> > is the file with the one job I want to run), and then did "crontab
> > -l".  Nothing.
> >
> > Are you familiar with the crontab format? If not, try this:
> > $ man 5 crontab
> 
> Yes, I am familiar with it, but here's the crontab I'm trying to set, in any
> case:
> 
> 0 * * * * monitorDataSource
> 
> >  >
> >  > I then went back to the administrator window.  I ran "cronevents".  This
> > didn't show anything more than the cron service being started.  I
> > then ran "cronbug".  I'm attaching the gzipped copy of this.
> >  >
> > You will have more luck running cron 'as yourself': it is straightforward.
> > Running it as a privileged user is more complicated.
> >
> > Is there a specific reason why you want to run it as system?
> 
> No, only because running it as myself didn't work.
> 
> In any case, I tried stopping and removing the service and rerunning cron-
> config, running the service as myself.  It didn't make any difference.  No
> response from "crontab -e", and "crontab crontab" seemingly ignored.  Nothing
> in "/var/log/cron.log", and nothing in "cronevents" except for the service
> stopping and starting.

Any more ideas about this?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-23 Thread bartels

On 09/23/2013 08:59 PM, bartels wrote:

cron-config does not accept SYSTEM as a user


Hmm, looking at the script, it would seem that cron-config is capable of 
configuring cron to run as system.

- bartels

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-23 Thread bartels

On 09/23/2013 08:08 PM, Andrey Repin wrote:

Greetings, bartels!


By the way: SYSTEM is not a user.

Since when?

Since Bill Gates stopped sleeping in his garage? :)
$ passwd SYSTEM
passwd: unknown user SYSTEM
Without knowing too much about Windows internals, I have always considered
SYSTEM to be a context, rather than a user.

Your assumption is wrong.

You are persuing a childish argument in semantics.
I think we both know what the SYSTEM means.

And windows loudly disagrees with you:

  $ net user SYSTEM
  The user name could not be found.


Greatly simplifying, NT AUTHORITY\SYSTEM is a
built-in access control group, under which whole system kernel works.


You are saying it: SYSTEM is a UAC.

Besides, your argument is off topic, as this thread is about setting up sshd.
cron-config does not accept SYSTEM as a user

Of course we both know that to be just a limitation of cron-config.

- bartels


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-23 Thread Andrey Repin
Greetings, bartels!

>>> By the way: SYSTEM is not a user.
>> Since when?

> Since Bill Gates stopped sleeping in his garage? :)

> $ passwd SYSTEM
> passwd: unknown user SYSTEM

> Without knowing too much about Windows internals, I have always considered
> SYSTEM to be a context, rather than a user. 

Your assumption is wrong. Greatly simplifying, NT AUTHORITY\SYSTEM is a
built-in access control group, under which whole system kernel works.
Taking out the rights for SYSTEM to f.e. access certain directory will prevent
most services from changing it.

> Please give me your take, if you have more info.
> I am interested

It's offtopic in this mailing list.
If you're interested in a full list of built-in users and groups, I suggest
you check the user list as given by ACL editors, when you use search function.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 23.09.2013, <22:01>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-23 Thread bartels

On 09/23/2013 04:44 PM, Andrey Repin wrote:

Greetings, bartels!


Greetings Andrey!




By the way: SYSTEM is not a user.

Since when?


Since Bill Gates stopped sleeping in his garage? :)

$ passwd SYSTEM
passwd: unknown user SYSTEM

Without knowing too much about Windows internals, I have always considered 
SYSTEM to be a context, rather than a user.

Please give me your take, if you have more info.
I am interested

- bartels.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-23 Thread Andrey Repin
Greetings, bartels!

>>> CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin
>>>
>>> I want to set up a cron job, so I have to get cron configured. I'm trying 
>>> to follow the instructions I can find, but I'm seeing several issues.
>>>
>>> I'm surprised that there's nothing in the user guide or the FAQ about 
>>> setting up cron.  I had to settle for the various questions about this 
>>> on StackOverflow and others.
>>

> By the way: SYSTEM is not a user.

Since when?


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 23.09.2013, <18:43>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-22 Thread Larry Hall (Cygwin)

On 9/21/2013 9:00 PM, KARR, DAVID wrote:

I'm surprised that there's nothing in the user guide or the FAQ about
setting up cron.  I had to settle for the various questions about this on
StackOverflow and others.


For Cygwin packages other than the one providing the Cygwin DLL itself,
Cygwin-specific documentation is provided under /usr/share/doc/Cygwin.
General package documentation is found under /usr/share/doc/.

--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-22 Thread bartels

On 09/22/2013 05:56 PM, bartels wrote:

On 09/22/2013 03:00 AM, KARR, DAVID wrote:

CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

I want to set up a cron job, so I have to get cron configured. I'm trying to 
follow the instructions I can find, but I'm seeing several issues.

I'm surprised that there's nothing in the user guide or the FAQ about setting up cron.  I had to settle for the various questions about this 
on StackOverflow and others.



>>> I want to set up a cron job, so I have to get cron configured.  I'm trying
>> to follow the instructions I can find, but I'm seeing several issues.
>>> I'm surprised that there's nothing in the user guide or the FAQ about
>> setting up cron.  I had to settle for the various questions about this on
>> StackOverflow and others.
>>
>> Must say your reporting of events is also lacking crucial elements
>> If you re-install and give me more details, then I will try and answer your
>> questions.
> Ok.  I assume you mean re-installing cron, not Cygwin.
Yes, cron-config is what I meant.
>
> I followed the process described in the FAQ for removing a service.  I then 
ran cron-config again.  When I did this before, I selected to run
cron as myself.  I decided to make it run as the local system account this time (first running "passwd -R" and entering my password).  It 
appeared to complete without errors or warnings.  I did this in a "run as administrator" window.

>
> In a normal window, I then ran "crontab -e".  I figured this would put me into 
"vi" with an empty buffer.  It just returned to the prompt.
You should see a vi session.
Do you have vi installed?
What is the value of EDITOR?

This could indicate a deeper problem, confusing not just cron.

> I then ran "crontab crontab" (the "crontab" file in my current directory is the 
file with the one job I want to run), and then did "crontab
-l".  Nothing.

Are you familiar with the crontab format? If not, try this:
$ man 5 crontab

>
> I then went back to the administrator window.  I ran "cronevents".  This 
didn't show anything more than the cron service being started.  I
then ran "cronbug".  I'm attaching the gzipped copy of this.
>
You will have more luck running cron 'as yourself': it is straightforward.
Running it as a privileged user is more complicated.

Is there a specific reason why you want to run it as system?

- bartels



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-22 Thread bartels

On 09/22/2013 05:56 PM, bartels wrote:

On 09/22/2013 03:00 AM, KARR, DAVID wrote:

CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

I want to set up a cron job, so I have to get cron configured. I'm trying to 
follow the instructions I can find, but I'm seeing several issues.

I'm surprised that there's nothing in the user guide or the FAQ about setting up cron.  I had to settle for the various questions about this 
on StackOverflow and others.




By the way: SYSTEM is not a user.

- bartels

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Confused about several issues with setting up cron

2013-09-22 Thread bartels

On 09/22/2013 03:00 AM, KARR, DAVID wrote:

CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

I want to set up a cron job, so I have to get cron configured.  I'm trying to 
follow the instructions I can find, but I'm seeing several issues.

I'm surprised that there's nothing in the user guide or the FAQ about setting 
up cron.  I had to settle for the various questions about this on StackOverflow 
and others.


Must say your reporting of events is also lacking crucial elements
If you re-install and give me more details, then I will try and answer your 
questions.

- bartels


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Confused about several issues with setting up cron

2013-09-21 Thread KARR, DAVID
CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin

I want to set up a cron job, so I have to get cron configured.  I'm trying to 
follow the instructions I can find, but I'm seeing several issues.

I'm surprised that there's nothing in the user guide or the FAQ about setting 
up cron.  I had to settle for the various questions about this on StackOverflow 
and others.

I must have done something at least half correct, because I believe this tells 
me that cron is running:

% cygrunsrv -L
cron

% cronevents
2013/09/20 21:14:06 [dk068x] crontab: PID 5924: (dk068x) LIST (dk068x)
2013/09/21 11:28:15 [dk068x] /usr/sbin/cron: PID 4980: (CRON) STARTUP (V5.0)
2013/09/21 11:28:16 [dk068x] cron: PID 8424: `cron' service started

However, I then do "crontab ", where "pathtomycrontabfile" 
is the path to my crontab file with the job I want to run.  I then do "crontab 
-l" and it prints nothing.  There is nothing in "/var/log/cron*".

I did get some errors when I ran "cron-config", but I unfortunately lost that 
output.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



  1   2   3   4   5   6   7   8   9   10   >