[Ilugc] standard in must be a tty -- why?

  • From: raamanp@xxxxxxxxxxx (pandarinathan raman)
  • Date: Mon, 2 Sep 2002 09:14:13 +0100 (BST)

cron jobs do not take any environment setting from
the profile files. Probably you need to set proper
environment variables like PATH,SSH_TTY etc. 
You may try by giving these 
enviroments in your cron script

Raman
--- Bhuvan A <bhuvanbk@xxxxxxxxxxxxx> wrote: > >   >
For your reference here is the sequence of

commands been executed in my
  > script(example):
  > 
  > $ ssh my_user@my_host tar -zcf mytar.tgz
my_dirs
  > $ scp my_user@my_host:mytar.tgz /tmp/
  > $ su root -c "mount -t ext2 -v /dev/hda6
/mnt/part6; sleep 3; mv mytar.tgz 
  > my_partion_dir -v; umount -v /mnt/part6"
  > 
  > I suppose the problem is while doing su. But i
am unable to narrow down 
  > the same. Hope to get some lights.

The problem is with su. When running su, the
standard
input must be a tty (to read the password). su
cannot receive
input from a pipe, or redirected file. Also, there
is no mention
in the manual about getting the password from a
file.


But anyway i am not using pipe or redirection in my
command. BTW, in
normal case it wont query for password, since the
user is belong to wheel
group and all the users of wheel group are trusted.
Again, if i run my
script from command prompt it runs fine as it is
expected to (it wont
query for password). The problem is while running in
crond. Any other
clue?

regards,
bhuvaneswaran


_______________________________________________
To unsubscribe email
Ilugc-request@xxxxxxxxxxxxxxxxxx with 
"unsubscribe <password> address"
in the subject or body of the message.  
http://www.aero.iitm.ernet.in/mailman/listinfo/ilugc ;

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com

Other related posts: