How do I make a command run as root at boot up under Fedora 3?
I have a file that looks like this:
and I want it to run at boot as root user. I tried putting it in /etc/rc.d/init.d but that didn't work. I figured I better ask you guys where the proper place for it is since lots of people ask me questions about linux and I don't have to tell them somthing improper if I can help it anyway.
you see /etc/init.d/rc5.d into the scripts when you go in init 5 when normal mysql is already runniin ?
I don't understand what you said here. I don't know what all the rc#.d folders do... only have clues. I know they cause things to start up at boot. MySQL doesn't run until I start it up with the command shown above. I don't understand how I can "see" anything going though any init stage.
easy, /etc/init.d/rc(i).d are directories where scripts are executed for init level 1 rc1.d, ... init level 5 rc5.d
At this stage if you want to run at boot a script you place it in the good level into an existing script or (more complex) you create your personnal script. Good luck
How do I create my own script? I've wented to know how to do that for a while. I think I'm ready to take that on.
There most likely is a mysql script in /etc/init.d but you don't have it selected to start at boot up. Does the command 'service mysql start' or 'service mysqld start' bring up the service. You could use the 'chkconfig' command as root to start the mysql daemon to start when you boot up.
chkconfig --list will print out a table of services and the runlevels they start in. It also gives the instructions to use to start a service on a certain run level. You probably want to start 'mysqld' under runlevels 3 and 5. There may be a second related service, but I'm not at my linux box to check. 'info mysql' may give more information.
Here is a skeleton InitV script for redhat:
If you notice the comment line in the script:# chkconfig: 2345 55 25
This line is used by chkconfig, so your script needs it. In other words, this is more than a comment line.
The scripts in /etc/init.d/ are linked to /etc/rc.d/rc.3 for example.
The number after 'rc.' is the run level where these scripts will start.
Scripts beginning with the letter 'S' are started during boot up in alphabetical order. Scripts starting with the letter 'K' are run during shutdown. Again, these are links to the scripts in /etc/init.d (same as /etc/rc.d/init.d, i.e. one directory location is a symbolic link to the other. )
There is also an /etc/rc.d/rc.local script that will run after the rc.d scripts run. However for the mysql server, you probably want to use the script that the system runs in /etc/init.d/ .
There may be a red hat gui'd equivalent to the 'chkconfig' program, for starting services.
|All times are GMT -5. The time now is 08:54 PM.|