MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've written a python script that allow users to choose between different X configuration (for example internal/external screen of a laptop, TV-out, ...). Now I would like this script to be run before server x and before kdm when linux is starting up and when i restart X server (ctrl-alt-backspace).
You need to put the script in runlevel 5 initialization. The runlevel initialization scripts are written by the distributor and they are different from distributor to distributor. I will describe how to do it in Fedora. Mandrake is very similar to Fedora so you can probably tailor what I have to say to Mandrake.
/etc/inittab contains a table of what scripts to run to initialize each runlevel. Runlevel 5 is run with X11. On Fedora specifying runlevel 5 results in all of the scripts in /etc/rc.d/rc5.d being run in alphabetical order. The last script in the list is S99local which is used for user addons to runlevel 5.
The first place that I would try the script is in /etc/rc.d/rc5.d/S99local.
Ok but first, if I put the script in rc5.d/S99local, the script is launched but it does not block the starting process. In other words, my script is launched and before I can do anything else, X is started. If I go to screen 1 (ctrl-alt-F1), I can see the menu of my script but x is now started. Second, when I will restart x (for example I want to use my external screen), I don't want to restart my system but only X.
Another possibility is the startx script, /usr/X11R6/bin/startx. Your startx script should contain a xinit command. You could try inserting your script into startx just ahead of the xinit command.
Another possibility is to rename startx to startx2. Then name your script startx and make the last command in your script startx2.
Does your script change XF86Config? If it does then how does it take care of the problem of two different users wanting to start X at the same time with two different configurations?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.