2

My /etc/rc.local script is quite simple, like this.

#!/bin/sh

touch /root/test1
touch /var/lock/subsys/local

touch /root/test2
modprobe -r ftdi_sio
modprobe ftdi_sio vendor=0x0403 product=0x6015

touch /root/test3
cd /root/IPNHost
./IPNHost
touch /root/test4

I don't understand why IPNHost c program is not being run in this case. It runs perfectly fine when I run rc.local from the command prompt, like this:

/etc/rc.local

This is CentOS 6.5.

UPDATE: I tried adding debug statements to see whether rc.local was really executed. I have all 4, test1, test2, test3, test4 in my root directory. What's happening here?

3
  • Similar question here stackoverflow.com/questions/7783341/… – Citylight Feb 12 '15 at 5:11
  • Yeah, I've tried a lot of things, but nothing works! – lppier Feb 12 '15 at 6:54
  • Does this program check that it is run as root? Have you tried running it as root yourself from /bin/sh? – Anthon Feb 12 '15 at 9:31
4

If you are using centOS 7 you also have to enable the rc-local service in systemd.

6
  • It's 6.5 , I trying to write a init.d script instead to launch the process now... – lppier Feb 12 '15 at 9:15
  • so did you try to put rc.local in /etc/rc.d/ and create symlink to it in /etc/ ? – taliezin Feb 12 '15 at 9:22
  • Yup I tried all the stuff in the other similar threads... not sure why it doesn't work. Maybe programs in rc.local have to end when the initialization ends? putting it in ~/.bashrc works better (still not perfect) but that's not what I want. – lppier Feb 12 '15 at 9:30
  • a bit strange but is there an 'S' script for local in the runlevel you are booting into? – taliezin Feb 12 '15 at 9:50
  • What's a 'S' script? Sorry... I'm at runlevel 3 – lppier Feb 12 '15 at 9:52
3

Due to systemd introduced in CentOS 7, the /etc/rc.d/rc.local not enabled by default, you should make /etc/rc.d/rc.local executable by your hand.

Just run

chmod a+x /etc/rc.d/rc.local

Answer extracted from this post.

0

Turned out that the IPNHost program was dependent on intel ipp libraries environment variables for which the location was not specified at that point of time during boot.

Did a script autoStart.sh

#!/bin/bash
source /opt/intel/bin/compilervars.sh intel64
cd /root/IPNHost
./IPNHost

The source /opt/intel/bin/compilervars.sh intel64 loads the required intel environment variables which specify where to find the dynamically loaded libraries.

In rc.local I then called autoStart.sh, this works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.