LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2007, 06:39 AM   #1
geoff_f
Member
 
Registered: May 2003
Location: Canberra, Australia
Distribution: openSUSE 11.3
Posts: 445

Rep: Reputation: 31
Delay with kdialog when run by root


I've constructed a script that uses kdialog. The dialog box appears immediately on being called, but takes about 20 secs after the box disappears to return with the result. This only happens with the 'root' user; a normal user experiences no delay. The 'root' user's shell reports 'kbuildsycoca running...' before launching the dialog box. This does not appear when a normal user runs this script. This happens with Suse 10.0 and openSUSE 10.2, but not with Knoppix 5.1.1 (ie, Knoppix has no delay with either user, and no 'kbuildsycoca running...' message). This short demo will illustrate the problem:
Code:
#!/bin/bash

# Try kdialog for the 1st time
Selection=$(kdialog --title "Kdialog Test" --radiolist "Please select an Option from the following list:" 1 Option1 on 2 Option2 off 3 Option3 off)
Result=$?														# Get dialog return result
echo "Result from 1st dialog =$Result"
echo "Selection =$Selection"

# Now try kdialog for the 2nd time
Selection=$(kdialog --title "Kdialog Test2" --radiolist "Please select an Option from the following list:" 1 Option1 on 2 Option2 off 3 Option3 off)
Result=$?														# Get dialog return result
echo "Result from 2nd dialog =$Result"
echo "Selection =$Selection"
What happens is that the first dialog appears pretty well immediately, then, after selecting an option and clicking on OK, there is a delay of about 20 seconds before the Result is echoed. Then the second dialog box appears without delay; after making the second selection, another 20 seconds delay occurs before the second Result is echoed.

Does anyone know what's going on here? Is there a setting that can fix this? At the moment it is stopping me from using kdialog in scripts run by root.

I've searched with Google and with LQ Search, but no joy. Any help would be really appreciated.

(Posting in this forum because I'm not sure whether it's a problem with bash, kde or SUSE.)
 
Old 05-13-2007, 12:57 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
I get this delay even when I call the script as normal user, no matter how often I do this. No delay appears if I don't use $() but echo the output into a file.

Interestingly, If I changed it to
Code:
#!/bin/bash

# Try kdialog for the 1st time
kdialog --title "Kdialog Test" --radiolist "Please select an Option from the following list:" 1 Option1 on 2 Option2 off 3 Option3 off > kdialog.output
Selection=$(cat kdialog.output)
Result=$?														# Get dialog return result
echo "Result from 1st dialog =$Result"
echo "Selection =$Selection"

# Now try kdialog for the 2nd time
Selection=$(kdialog --title "Kdialog Test2" --radiolist "Please select an Option from the following list:" 1 Option1 on 2 Option2 off 3 Option3 off)
Result=$?														# Get dialog return result
echo "Result from 2nd dialog =$Result"
echo "Selection =$Selection"
then BOTH runs go quick, even though the second one is with your code. If I change the first one back to your code BOTH runs take long.

kdialog looks nicer, but If I need something like this I use Xdialog which starts much quicker as far as I have experienced.
 
Old 05-14-2007, 04:35 AM   #3
geoff_f
Member
 
Registered: May 2003
Location: Canberra, Australia
Distribution: openSUSE 11.3
Posts: 445

Original Poster
Rep: Reputation: 31
titopoquito, thanks very much for your reply. The same thing works for me, and solves my problem! I can live with using a temp file intermediary, as long as it gets the job done.

But as to why it would behave like that, it's just too bizarre for words.

Once again, many thanks.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
kdialog error pujansrt Linux - General 1 09-21-2006 10:27 AM
SSh password with kdialog oTTo001 Linux - Software 4 05-11-2006 08:15 AM
kdialog replacement Khabi Linux - Software 2 04-09-2005 01:10 AM
Variable info in kdialog? Klas Programming 1 01-08-2005 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration