Mail Archives: cygwin/2006/01/10/20:47:16
>Subject: Re: Help : can not get cron work
>Date: Tue, 10 Jan 2006 18:52:11 -0500 (EST)
>
>On Tue, 10 Jan 2006, lin q wrote:
>
> > > Isn't 'H' a network drive? That is probably your problem -- read
> > > <http://cygwin.com/faq/faq.using.html#faq.using.shares>.
> >
> > Thanks, I think you are right, after check out this page, I think it is
> > the problem.
> >
> > But I wonder how we can do it.
>
>Well, for one thing, the only reason you need H: is because your home
>directory is on it. You can have a home directory on a local drive
>instead, so that it's accessibe to services (you can then create a
>symbolic link from your home directory to the network drive).
This is something I am confused.
Here is my crontab,
$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.5456 installed on Tue Jan 10 18:22:18 2006)
# (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $)
USER=linq
USERNAME=linq
HOME=/cygdrive/c/home/linq
HOMEDRIVE=C:
* * * * * echo $LOGNAME > /tmp/logname 2>&1
* * * * * echo "home=$HOME user=$USER username=$USERNAME hostname=$HOSTNAME
homedrive=$HOMEDRIVE" > /tmp/ulog 2>&1
* * * * * ssh -vv hican > /tmp/ssh_log 2>&1
And here is the contents of /tmp/ulog and /tmp/logname which log environment
variables,
$ cat /tmp/ulog
home=/cygdrive/c/home/linq user=linq username=linq hostname=linq2
homedrive=C:
$ cat /tmp/logname
linq
You can see that the home is on C drive which is my local drive.
But here is /tmp/ssh_log which logs the exact ssh errors, and you can see
that it goes to access H drive.
OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005
Pseudo-terminal will not be allocated because stdin is not a terminal.
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to hican [149.199.109.155] port 22.
debug1: Connection established.
Could not create directory '/cygdrive/h/.ssh'.
debug1: identity file /cygdrive/h/.ssh/identity type -1
debug1: identity file /cygdrive/h/.ssh/id_rsa type -1
debug1: identity file /cygdrive/h/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version
OpenSSH_3.6.1p2
debug1: match: OpenSSH_3.6.1p2 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.2
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit:
diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc AT lysator DOT liu DOT se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc AT lysator DOT liu DOT se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160 AT openssh DOT com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160 AT openssh DOT com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib AT openssh DOT com,zlib
debug2: kex_parse_kexinit: none,zlib AT openssh DOT com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit:
diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc AT lysator DOT liu DOT se
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc AT lysator DOT liu DOT se
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160 AT openssh DOT com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160 AT openssh DOT com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 133/256
debug2: bits set: 511/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug2: no key of type 0 for host hican
debug2: no key of type 2 for host hican
debug1: read_passphrase: can't open /dev/tty: No such device or address
Host key verification failed.
Here is /etc/ssh_config,
# $OpenBSD: ssh_config,v 1.20 2005/01/28 09:45:53 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
# EscapeChar ~
>
> > There are 3 suggestions over there,
> > 1) using public network share that does not require authentication (for
> > non-critical files)
> > 2) providing your password to a net use command
> > 3) running the service as your own user with cygrunsrv -u
> >
> > But 1) does not apply here in my environemnt.
>
>Ok.
>
> > 2), I do not quite understand it. And I think I can not use it either. I
> > tried "net use H: *" trying to set up the password, but it errors out on
> > syntax.
>
>That's because "net use" expects the full path to the share as part of the
>command (if you want to attach to it). So, just figure out what share H:
>is referring to (say, \\server\SHARE), and then issue the following
>command:
>
>net use H: '\\server\SHARE' '*'
>
>(the quoting is for bash -- I think you can omit it at the DOS prompt).
>
> > 3), In the very beginning I used cygrunsrv command to start cron, but
> > there is some problem. And earlier in this thread I was suggested to use
> > cron-config. Actually below are the screenshot of my running
> > cron-config, you can see that it specifically asked me whether to setup
> > the service as my own,
> >
> > $ /usr/bin/cron-config
> > Cron is already installed as a service under account XLNX\jibinh.
> > 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
> > 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.
> > Do you want to the cron daemon to run as yourself? (yes/no) yes
> >
> > Do you want the daemon to run with ntsec? (yes/no) yes
> >
> > Please enter the password for user 'linq': ******
> > Reenter: ******
> >
> > WARNING: /usr/sbin/sendmail should point to an executable mailer
> > such as ssmtp or exim.
> >
> > 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
> > for information about the problem cron is having.
> >
> > If you cannot fix the problem, then report it to cygwin AT cygwin DOT com.
> > Please include a copy of your crontab, ('crontab -l')
> > and the output of 'cygcheck -srv > cygcheck.txt'.
> >
> > Please include the generated file 'cygcheck.txt' *as an attachment*,
> > and NOT in the body of the mail message.
>
>Umm, okay, this seems to have completed successfully. Is cron now
>running? Does the simple "hello world" example work? What error does
>your original rsync command give in this case?
Cron is running, I think the problem is SSH does not work in cron.
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -