LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-03-2017, 11:36 AM   #1
adkPrasanna
LQ Newbie
 
Registered: Mar 2016
Posts: 29

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, 11:37 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

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

Please see here: http://www.linuxquestions.org/questi...#faq_lqwelcome for information about asking a good question.

Last edited by szboardstretcher; 01-03-2017 at 11:39 AM.
 
Old 01-03-2017, 11:38 AM   #3
adkPrasanna
LQ Newbie
 
Registered: Mar 2016
Posts: 29

Original Poster
Rep: Reputation: Disabled
/etc/rc.d/rc.local

Slackware 14.2
 
Old 01-03-2017, 11:49 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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, 12:00 PM   #5
Noryungi
Member
 
Registered: Jul 2003
Location: --> X <-- You are here.
Distribution: Slackware, OpenBSD
Posts: 305

Rep: Reputation: 53
/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, 05:15 PM   #6
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687
Blog Entries: 1

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


Reply



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 03:34 AM
Need local postfix to send NDR if local user address is not found Rincewind2 Linux - Software 0 08-08-2015 08:44 PM
how can i add a local Folder on local Hard Disk as Yum Repository ?? vahid_p Fedora 4 02-22-2007 10:43 AM
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:08 AM.

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