Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 07-17-2004, 11:24 AM   #1
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, 11:49 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
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.


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 04:59 PM
telnet server not reliable for expect script powah Linux - Software 0 11-16-2005 12:07 PM
cron job for expect script ruchitadesai Programming 9 05-27-2005 05:34 AM
trying to execute an expect script in .bashrc smaudlin Red Hat 2 01-02-2005 02:34 AM
Expect script throws "open(slave pty): bad file number" error KNut Linux - Newbie 0 02-24-2004 01:24 PM > Forums > Linux Forums > Linux - General

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

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