Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
02-05-2016, 04:23 PM
|
#1
|
Member
Registered: Jan 2016
Posts: 254
Rep: 
|
Centos 7.2 /etc/rc.local replaced?
Hi
I was use on Centos 6.x this:
and i add:
Code:
rm -f /var/sphinx/*.spl
/usr/local/bin/searchd --config /sphinxconfig/sphinx.conf
Now on Centos 7.2 this file is not used or it doesn't do exactly what was do or is not recommended for such edits.....
Can you please help me with this as i do not know what to edit or how to fix it now ?
Thank you
|
|
|
02-05-2016, 11:32 PM
|
#2
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
Is the file executable?
Normally it would also have a "#!/usr/bin/bash" as the first line.
I believe it is only used if it is executable.
|
|
|
02-06-2016, 12:09 AM
|
#3
|
Member
Registered: Jul 2013
Posts: 749
Rep: 
|
With systemd you need to enable the rc-local.service
Code:
systemctl enable rc-local.service
|
|
|
02-06-2016, 08:43 AM
|
#4
|
Member
Registered: Jan 2016
Posts: 254
Original Poster
Rep: 
|
yes it has on the first line the:
No it is not executable... Ok i did it now....
Do i have to use also this?
Code:
systemctl enable rc-local.service
|
|
|
02-06-2016, 12:36 PM
|
#5
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
yes (though you can drop the ".service" part.
You can test it without rebooting by "systemctl start rc-local"
|
|
|
02-06-2016, 08:34 PM
|
#6
|
Member
Registered: Jan 2016
Posts: 254
Original Poster
Rep: 
|
This is what i got
Code:
[root@server ~]# chmod +x /etc/rc.d/rc.local
[root@server ~]# systemctl enable rc-local
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
|
|
|
02-06-2016, 08:43 PM
|
#7
|
Member
Registered: Jul 2013
Posts: 749
Rep: 
|
Try putting your rc.local file in /etc/rc.d/rc.local, make sure it's marked as executable.
I haven't used rc.local in a couple years, apparently you no longer need to enable the rc-local.service, it's now a static unit.
|
|
|
02-06-2016, 08:48 PM
|
#8
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
I think you can ignore that (I get it too).
Service units that do have an install section also have a "WantedBy=..." entry. rc.local doesn't have any services that depend on it.
|
|
|
All times are GMT -5. The time now is 08:04 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|