Permits in file /etc/rc.d/rc.local

MindServer

Well-Known Member
Mar 18, 2020
129
17
18
Spain
cPanel Access Level
Root Administrator
I need enable auto-start mdadm monitoring/scan. I readed some posts where do this in "rc.local" file, and change her permits with this command: chmod +x /etc/rc.d/rc.local

I asked some people and says me that maybe this isn't safe.

-Can I have any security problem if I change rc.local's permits with this command?: chmod +x /etc/rc.d/rc.local
-Which permits should have rc.local?.

Thank you!
 
Last edited:

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
12,377
1,129
313
Houston
I don't see the reason for doing this when mdmonitor will auto-start if you configure the service properly - there are a ton of tutorials on this but it is beyond the scope of cPanel's support.
 
  • Like
Reactions: MindServer

Michael Svendsen

Well-Known Member
Dec 19, 2016
76
21
83
Denmark
cPanel Access Level
Root Administrator
Agree with @cPanelLauren ,.. what are you trying to achieve by starting mdadm scan at server start? :)
 
  • Like
Reactions: MindServer

MindServer

Well-Known Member
Mar 18, 2020
129
17
18
Spain
cPanel Access Level
Root Administrator
Agree with @cPanelLauren ,.. what are you trying to achieve by starting mdadm scan at server start? :)
I have server in OVH, they configure automatically RAID 1. I only want to monitoring and receive email alert if have any problem in hard disks.

I readed some guides in internet and they says this:

1- Send alert to email if some disk have problems: nano /etc/mdadm.conf -> add to bottom "MAILADDR root"
2- Enable the scan and monitoring: mdadm --monitor --scan --daemonize
3- Enable the scan and monitoring when restart the server: nano /etc/rc.d/rc.local -> add to bottom "mdadm --monitor --scan --daemonize"
4- Change rc.local permits: chmod +x /etc/rc.d/rc.local

-This is correct steps or you recommend me other configuration?.
-Is safe change rc.local's permits?.

Thank you very much. Have a nice day!
 

MindServer

Well-Known Member
Mar 18, 2020
129
17
18
Spain
cPanel Access Level
Root Administrator
Hi,

I asked some sysadmins and I will add more information (sorry I cannot edit the last message):

-Maybe I will get same result if I enable mdmonitor with "systemctl start mdmonitor" and "systemctl enable mdmonitor"?
-If I enable mdmonitor not need use command "mdadm --monitor --scan --daemonize" for monitorize and receive alerts?

Thank you!
 
  • Like
Reactions: cPanelLauren

Michael Svendsen

Well-Known Member
Dec 19, 2016
76
21
83
Denmark
cPanel Access Level
Root Administrator
Hi,
You probably already have a /etc/cron.d/raid-check file and its configuration at /etc/sysconfig/raid-check (at least the defaults).
Raid-check by default checks your raid once per week and will output any errors to stdout - thus beeing mailed to root.

You can also set up some monitoring tool to monitor /proc/mdstat.. :)
 

MindServer

Well-Known Member
Mar 18, 2020
129
17
18
Spain
cPanel Access Level
Root Administrator
Hi,
You probably already have a /etc/cron.d/raid-check file and its configuration at /etc/sysconfig/raid-check (at least the defaults).
Raid-check by default checks your raid once per week and will output any errors to stdout - thus beeing mailed to root.

You can also set up some monitoring tool to monitor /proc/mdstat.. :)
Thank you very much friend. OVH configure automatically RAID 1, I only want to receive notifications in my email if the SSD have any problem.

This is my questions for can finalize configurations:

-If I enable mdmonitor with "systemctl start mdmonitor" and "systemctl enable mdmonitor", not need use command "mdadm --monitor --scan --daemonize" for monitorize and receive alerts?

Thank you!!
 
Last edited:

Michael Svendsen

Well-Known Member
Dec 19, 2016
76
21
83
Denmark
cPanel Access Level
Root Administrator
Ah yes, sorry :)
You can run systemctl enable mdmonitor and systemctl start mdmonitor
By default it will send warnings to root.
 
  • Like
Reactions: MindServer