LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-18-2005, 06:55 AM   #1
hyllplan
Member
 
Registered: Nov 2004
Location: Stockholm, Sweden
Distribution: Debian (Sarge), Red Hat, Ubuntu, Knoppix
Posts: 99

Rep: Reputation: 15
two different XF86Configs


Hi,

I have two different XF86Config files that I want use at different runlevels.
Whats the easiest way to implement that?

I guess I have to do something about the /etc/inittab?

part of my inittab:

# The default runlevel.
id:2:initdefault:

Im using Debian Sarge

BTW, I am not starting X with startx i saw that there was a flag available to choose config file.

- Johan
 
Old 05-18-2005, 11:48 PM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
the XF86config file wil be used only for runlvel 5 or 4 whichever is GUI or u won't required that file
so u do not require that file for runlevel 2

regards
 
Old 05-18-2005, 11:53 PM   #3
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
you could have your XF86Config be a symlink, and have a script for reach runlevel that removes the symlink and makes a new one to the file you want to use.
 
Old 05-19-2005, 05:27 AM   #4
hyllplan
Member
 
Registered: Nov 2004
Location: Stockholm, Sweden
Distribution: Debian (Sarge), Red Hat, Ubuntu, Knoppix
Posts: 99

Original Poster
Rep: Reputation: 15
Way to go

masand said:

"the XF86config file wil be used only for runlvel 5 or 4 whichever is GUI or u won't required that file
so u do not require that file for runlevel 2"

and I say - that would be true for RedHat or whatever distribution, but NOT for Debian, Debian uses runlevel 2 as GUI (default)

whansard - thanks for your tip i cant believe I did not think of that myself! Simple and powerful thats the way to go!
I have now created a startup script in each runlevel (well at least in 2 and 3) that performs whatever I would like to change e.g. different XF86Config-4, it works great!

Here are the instructions:

1) Copy e.g. cron startupscript to a new file and edit that one, here is an example:

#!/bin/sh

case "$1" in
start) echo -n "Making changes for runlevel nr2"
rm -f /etc/X11/XF86Config-4
ln -s /etc/X11/XF86Config-4_Xinerama /etc/X11/XF86Config-4
echo "."
;;
stop) echo "Not implemented. "
exit 0
;;
restart) echo "Not implemented. "
exit 0
;;
reload|force-reload) echo "Not implemented. "
exit 0
;;
*) echo "Usage: /etc/init.d/rlev2 start|stop|restart|reload|force-reload"
exit 1
;;
esac
exit 0

2) Make necessary startuplinks to make the script execute before X is started

3) Edit lilo or grub or whatever to contain startupentries for different runlevels

Done!
 
Old 05-19-2005, 06:03 AM   #5
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
thanks for correcting me and for the info. on debian

regards
 
  


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



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:12 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