Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-03-2017, 12:36 PM   #1
LQ Newbie
Registered: Mar 2016
Posts: 14

Rep: Reputation: Disabled
Smile /etc/rc.d/rc.local

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?
Old 01-03-2017, 12:37 PM   #2
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,213

Rep: Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614
What operating system and version?

Please see here: for information about asking a good question.

Last edited by szboardstretcher; 01-03-2017 at 12:39 PM.
Old 01-03-2017, 12:38 PM   #3
LQ Newbie
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled

Slackware 14.2
Old 01-03-2017, 12:49 PM   #4
LQ Guru
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,518

Rep: Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262Reputation: 3262
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).
Old 01-03-2017, 01:00 PM   #5
Registered: Jul 2003
Location: --> X <-- You are here.
Distribution: Slackware, OpenBSD
Posts: 304

Rep: Reputation: 50
/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).
Old 01-03-2017, 06:15 PM   #6
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 288

Rep: Reputation: 135Reputation: 135
BTW, you may also want to create/update /etc/rc.d/rc.local_shutdown if the command has special concerns during shutdown


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix local email server fails to deliver local mail 2UCowpoke Linux - Server 2 09-22-2015 04:34 AM
Need local postfix to send NDR if local user address is not found Rincewind2 Linux - Software 0 08-08-2015 09:44 PM
how can i add a local Folder on local Hard Disk as Yum Repository ?? vahid_p Fedora 4 02-22-2007 11:43 AM
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 06:04 AM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 08:11 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration