solarian Posted January 24, 2007 Report Share Posted January 24, 2007 Hi! I want my OS to run one command every time on boot before startx (X) (on runlevel 5 and 3) I want it as root run something like this: /usr/share/program/program -param1 -param2 Where do I write in that command line in Fedora as well as in Mandriva? Thanks, you're the best! Quote Link to comment Share on other sites More sharing options...
dexter11 Posted January 24, 2007 Report Share Posted January 24, 2007 xinitrc ???????? Quote Link to comment Share on other sites More sharing options...
solarian Posted January 24, 2007 Author Report Share Posted January 24, 2007 So I can edit the xinitrc config file to add a command I wish to be executed before X starts? Quote Link to comment Share on other sites More sharing options...
pindakoe Posted January 24, 2007 Report Share Posted January 24, 2007 Anotehr place: Daemons / services are usually started from /etc/init.d/ via the System V init system. You can define for which run levels this should be done, so level 3 and 5 in your case. Yet another place: .bash_profile (per user) or /etc/profile (all users) after their logon has been completed. Quote Link to comment Share on other sites More sharing options...
coverup Posted January 25, 2007 Report Share Posted January 25, 2007 Anotehr place: Daemons / services are usually started from /etc/init.d/ via the System V init system. You can define for which run levels this should be done, so level 3 and 5 in your case. Yet another place: .bash_profile (per user) or /etc/profile (all users) after their logon has been completed. I concur with the above. Commands/scripts which you want to run after all init scripts have finished and before X starts must be put in /etc/rc.local which is symlinked to /etc/rc.d/rc.local: $ head /etc/rc.d/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. Quote Link to comment Share on other sites More sharing options...
camelrider Posted January 26, 2007 Report Share Posted January 26, 2007 When placing commands in .xinitrc use an ampersand at the end of each command except the last one to enable the script to coontinue until all commands are completed. Example: rxvt -geometry 108x44+0+0 & exec startkde Quote Link to comment Share on other sites More sharing options...
coverup Posted January 26, 2007 Report Share Posted January 26, 2007 When placing commands in .xinitrc use an ampersand at the end of each command except the last one to enable the script to coontinue until all commands are completed.Example: rxvt -geometry 108x44+0+0 & exec startkde IMHO, .xinitrc is not always a right place to put commands. As the name suggests, this file is for X init stuff - like in the example above. If the commands you want to use are not related to X (e.g., networking, printing, starting/stopping daemons, mounting/remounting of partitions), place them in rc.local Quote Link to comment Share on other sites More sharing options...
solarian Posted January 26, 2007 Author Report Share Posted January 26, 2007 (edited) Thanks for the info, guys! I already solved my problem through other means, but this is useful to know. Edited January 26, 2007 by solarian Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted January 26, 2007 Report Share Posted January 26, 2007 Through other means? Could you post the solution here for others or state that you decided not to do it this way (abandoned it)? Quote Link to comment Share on other sites More sharing options...
solarian Posted January 26, 2007 Author Report Share Posted January 26, 2007 Well, the problem was that FC didn't detect my laptop wide screen correctly and didn't offer resoltuions I needed. Hacking xorg didn't fix the problem, because it was a chip bios problem. So I found out on the net that there is a special script (915 resolutions) that fixes my problem. Unfortunately it had to be launched in a no X environment. Anyway, because of a problem with wifi I installed Mandriva ONE 2007 on my laptop and upon resolution selection it offered me to automatically install 915 resolutions and set it up to launch it every time before X upon boot. So my solution in this case is to run Mandriva ONE instead of Fedora Core 6 on my laptop. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.