SlackwareThis Forum is for the discussion of Slackware 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.
Is rc.local file to run command at boot time?
I am using this file to start various scripts and programs while the system loads. Especially mysql.server script.
Is it safe?
Yes, /etc/rc.d/rc.local is a place for you to add your own commands to Slackware's boot process. The script will be the last thing run before you are presented with your login prompt (runlevel 3) or starting up the graphical login (runlevel 4). Due to this, make sure all processes are daemonized (if the program supports it) or backgrounded properly (using an ampersand & at the end of the command), otherwise you won't get a login prompt.
However, I'm not familiar with a mysql.server script. Is this a personal script or something more complex? Some light googling didn't shed any light. It might be worth adding it to the rc.mysqld script, as then it can be run when the database daemon is started (and, if needed, you could add commands to stop it when the daemon is stopped or restarted).
/etc/rc.d/rc.local is for scripts that are specific to a given machine.
Of course, you can start MySQL from rc.local, but as bassmadrigal pointed out, it's better to use /etc/rc.d/rc.mysql for this.
For instance, I have used rc.local to add very specific route commands to the system configuration, or to start a few exotic process (including configuration or file backup or replication that must be run every time the computer/server starts).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.