[mythtv-users] OT: Need to log out of console or restart X via script

Jarod Wilson jarod at wilsonet.com
Sat Dec 10 16:37:47 EST 2005

On Saturday 10 December 2005 11:01, mythtv-users at fastdruid.co.uk wrote:
> On Saturday 10 December 2005 18:15, Rob Bongiovi wrote:
> > Hi! I'm not very experienced in Linux and need some
> > help with something.
> <snip>
> > But, I can't figure out either without quickly getting
> > confused. If someone could help me, I'd appreciate it.
> > Here's what I want to do:
> >
> > #First kill any mythfrontend process that is running
> > sudo killall mythfrontend
> > #<insert logout or restart X command here>
> > sudo mythfrontend -l /var/log/mythtv/mythfrontend.log
> > &
> Firstly ISTR Jarod has a section with a 'restart' script and how to link it
> to your remote, base a script on that.
> The exact syntax depends on your distro but there is a rc script that
> starts (or stops X), it's called xdm (on suse anyway), call that with
> restart and it'll kill X and then restart it.
> ISTR fedora has a program/script called service which allows you to run rc
> scripts, suse has links from them in /sbin or /usr/sbin (for
> example /usr/sbin/rcxdm -> /etc/init.d/xdm), other distros may have
> something different or nothing at all (you have to call the script
> directly). I'm assuming you're using fedora and going for /sbin/service (at
> least I _think_ it's in /sbin ;-)  )
> Create a little script something like:
> #/bin/bash
> sudo killall mythfrontend
> sudo /sbin/service xdm restart

If using RH/Fedora, there is no xdm startup script, its launched from inittab, 
so simply killing X will restart the login manager.

> (obviously check it'll work from a ssh/console session first)
> If you need to load/unload things (for example if your driver is buggy) go
> for something like (obviously 'a-framebuffer-module' should be replaced by
> the module you need to reload):
> #/bin/bash
> sudo killall mythfrontend
> sudo /sbin/service xdm stop
> sudo rmmod a-framebuffer-module
> sudo modprobe a-framebuffer-module
> sudo /sbin/service xdm start

Change the xdm stop to "init 3" and the xdm start to "init 5" to achieve this 
on RH/FC.

Jarod Wilson
jarod at wilsonet.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20051210/cd009180/attachment.pgp

More information about the mythtv-users mailing list