View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 7 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Oct 18, 2006 9:15 pm 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
As user mythtv, I can run the following command and successfully restart GDM:
Quote:
sudo /etc/init.d/gdm restart


If I bind this action to a key in fluxbox (F8 in my example)

Quote:
/etc/X11/fluxbox/keys

None F8 :ExecCommand sudo /etc/init.d/gdm restart


...and I execute the F8 key, GDM stops but never comes back. My screen goes crazy until I restart GDM from a command shell (either as user mythtv or as root)

What is the difference between executing the command as user mythtv via command line versus executing it as user mythtv via a fluxbox key?

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Last edited by ed3120 on Thu Oct 26, 2006 9:53 am, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 12:01 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
Well, a restart is a stop followed by a start. The stop killed gdm, including fluxbox and the gdm restart command since it was executied within fluxbox.... before it could do the start.

You might try
Code:
sudo /etc/init.d/gdm restart &
to put it in the background, or possibly:
Code:
sudo /etc/init.d/gdm restart > /dev/null 2>&1 &
I've never tried it and have never understood the parent/child process rules, but it might work.

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 8:16 am 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
Excellent point...I wasn't thinking of it that way.

Could you explain what the:
Code:
> /dev/null 2>&1 &


part of your process is for? Thanks!!

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 9:41 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
The "> /dev/null" redirects the standard output to /dev/null. The "2>&1" sends standard error to the same place. This is because gdm restart prints out some messages and I'm not sure what happens if it tries to send output to a non-existent screen. The may not be necessary.

The "&" puts the process in the background and returns control. Try "(sleep 10;ls)&" from the command line and you will see what happens. The command prompt comes back immediately, but the ls output appears 10s later.

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 10:09 am 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

I would suggest to put your restart command into a script for root to run and then call the script from the key

something simular to:
/usr/local/bin/restart-gdm

#!/bin/sh
#
sudo /etc/init.d/gdm restart &

Then when you activate the magic key the seperate script will run regardless of what the gdm is doing.
ExecCommand sudo /usr/local/bin/restart-gdm

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 9:52 am 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
This is the line that solved what I was trying to accomplish....

Quote:
sudo /etc/init.d/gdm restart > /dev/null 2>&1 &


Thanks!!

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Top
 Profile  
 
PostPosted: Thu Jan 03, 2008 2:58 pm 
Offline
Joined: Fri Mar 24, 2006 10:35 pm
Posts: 89
Location: Detroit, MI
Thanks guys. I added to my keyboard shortcuts within /etc/X11/fluxbox/keys
Code:
Mod1 i :ExecCommand sudo firefox&

So now alt i will now start firefox on my mythbox and I can look at the sports scores while I DVR timeshift the games.
My homepage will be http://localhost/RRD/daily webpage for my mythbox. I hope to add a shutdown key with:
Code:
Mod1 4 :ExecCommand sudo shutdown -h now


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu