LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-17-2004, 10:24 AM   #1
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Rep: Reputation: 30
BAD SU- from a cronned expect script


I have made an expect script which telnets to a machine, and then su's. It works perfectly when this script is executed manually. However when i put it in a cronjob, i get the error "BAD SU-" on the remote machine. The passworsd, and groups are fine for the user, other wise I would have the same error when i execute the script manually.. what could be the problem?!?
 
Old 07-18-2004, 10:49 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,770

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
I've seen similar problems posted wherein a script fails when trying to connect to another machine. One explanation is that the script commands run too quickly and sort of overruns the other machine's response time, resulting in an error. One fix that may work is to insert a time delay between connection and su to give the other machine a chance to catch up to your script: something like sleep 5s, meaning sleep 5 seconds, then continue.
It's worth a try.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expect Script coolest Programming 7 02-16-2009 03:59 PM
telnet server not reliable for expect script powah Linux - Software 0 11-16-2005 11:07 AM
cron job for expect script ruchitadesai Programming 9 05-27-2005 04:34 AM
trying to execute an expect script in .bashrc smaudlin Red Hat 2 01-02-2005 01:34 AM
Expect script throws "open(slave pty): bad file number" error KNut Linux - Newbie 0 02-24-2004 12:24 PM


All times are GMT -5. The time now is 10:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration