Expect debug output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Expect debug output
# 1  
Old 01-11-2011
Expect debug output

Hi!

I want to start OO in headless mode via expect -

the oo command would be

Code:
su - root -c "/usr/lib/openoffice/program/soffice -headless -nofirststartwizard -norestore -nolockcheck -nocrashreport -nodefault -accept='socket,host=0.0.0.0,port=8100;urp;StarOffice.Service'"

and the expect script I do use so far is:


Code:
#!/usr/bin/expect -d
set password superGeHeim
set timeout -1
spawn su - root -c "/usr/lib/openoffice/program/soffice -headless -nofirststartwizard -norestore -nolockcheck -nocrashreport -nodefault -accept='socket,host=0.0.0.0,port=8100;urp;StarOffice.Service'"
match_max 100000
expect "*?asswor?:*"
send -- "$password\r"
send -- "\r"
expect eof

which works with simple commands like kate. However oo is not starting at all, giving no errors or anything. expect -d doesnt help, no errors are provided.

The expect output is telling me it sets the password and returns normally.
I wonder what I can do to get any errors provided by soffice during startup, or what I might do different here to get this sorted?

Thank you in advance,

br

andreas
# 2  
Old 01-11-2011
We run ooffice headless. We created an init script that uses sudo (with NOPASSWD) to become the user to run it as.
Code:
/usr/bin/sudo -b -H -i -u someuser $soffice_BIN -headless -accept='socket,port=8100;urp;' &

# 3  
Old 01-12-2011
Hi,

Thanks for the hint.. unfortunately the average user of my app is a noob and will most likely not be able to configure sudoers properly.. because if he could do that, he could add the startup script to etc/init.de anyways. So I am looking for a way to let the user specify an account and passwort, and do the expect thing Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect Script - Not Seeing Output from While Loop

I know something simple is missing here, "log_user 1" is set . . . after this utility opens ${InFile} (handle? for IntInFile) it needs to look for something to appear in the file ${IntInFile} and then send it to the spawned process. Then I am locking the file ${IntInFile} and clearing it out -... (0 Replies)
Discussion started by: JuanMatteo
0 Replies

2. Shell Programming and Scripting

How do I use grep output in an expect script?

Hi, I am using expect to ssh to a remote host and run a program on the remote machine which has a variable runtime. I need to wait until it finishes so I can grab the output file of this program. I am trying to use the output of grep to know when the process finishes. I am trying to capture... (0 Replies)
Discussion started by: vagabond1964
0 Replies

3. Shell Programming and Scripting

Help capturing output of expect script

match_max 500000 set timeout 30 set outcome1 {} set outcome2 {} set inputfile C:\\Users\\Administrator\\Desktop\\inputfile.txt send -i $con "\r"; expect -i $con "Desktop>" { exp_send "type $inputfile \r" } set timeout 30 expect { "Desktop>" { set outcome $expect_out(0,string);}... (3 Replies)
Discussion started by: cityprince143
3 Replies

4. Shell Programming and Scripting

Expect doesn't output the logs

(qemu) migrate -d tcp:192.168.122.1:4444 (qemu) info migrate capabilities: xbzrle: off Migration status: completed total time: 4425 milliseconds downtime: 3 milliseconds transferred ram: 130338 kbytes remaining ram: 0 kbytes total ram: 1057152 kbytes duplicate: 232613 pages normal:... (0 Replies)
Discussion started by: yanglei_fage
0 Replies

5. Shell Programming and Scripting

Want ro capture the debug in output file

I want to capture the debug for the below command in output file . i tried like this but its not working: sh -xv <scriptname> >> output.log i want the output in a log file. Anyone plz help in this (2 Replies)
Discussion started by: chakkaravarthy
2 Replies

6. Shell Programming and Scripting

how to debug an expect script running on a tomcat server

Hello everyone, I have a small expect script as follows; #!/usr/bin/expect -f set force_conservative 0 ;# set to 1 to force conservative mode even if ;# script wasn't run conservatively originally if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg}... (1 Reply)
Discussion started by: randeel
1 Replies

7. Shell Programming and Scripting

Expect - Interact output hangs when large output

Hello, I have a simple expect script I use to ssh to a workstation. I then pass control over to the user with interact. This script works fine on my HP and Mac, but on my Linux Desktop, I get a problem where the terminal hangs when ever I execute a command in the interact session that requires a... (0 Replies)
Discussion started by: natedog
0 Replies

8. Shell Programming and Scripting

want to use output of c programme in expect

hi i am having a c code which gives the output of my password in text format i.e when i run my c code which which gives the password asfollows====>>>>>> $./passwdprogram ======>>>>>>abc@123(this is the output) now i have an expect script to remotely ssh which uses the password set in ... (0 Replies)
Discussion started by: xander
0 Replies

9. Shell Programming and Scripting

Get the output from EXPECT ?

I'm using expect script, but don't know how to assign an output to a string variable. Any help ? Thank you for reading! PS: In fact i want to get the out put of expect when run grub-md5-crypt to generate MD5 password for GRUB boot loader. My code:#!/bin/sh #\ exec expect -f "$0" ${1+"$@"}... (4 Replies)
Discussion started by: fongthai
4 Replies

10. Shell Programming and Scripting

Easiest way to send output to a debug file?

I have this in my script: DEBUG_DIR=/log/rotate_output DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP} SERVER_FILE_LIST="\ wasint0206 /logs/squid_backup wasint0201 /logs/squid_backup" /usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY do cd /log/squid_logs/${SERVER}... (2 Replies)
Discussion started by: LordJezo
2 Replies
Login or Register to Ask a Question