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/…
    – Sreeraj
    Commented Feb 12, 2015 at 5:11
  • Yeah, I've tried a lot of things, but nothing works!
    – lppier
    Commented Feb 12, 2015 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
    Commented Feb 12, 2015 at 9:31

3 Answers 3

5

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
    Commented Feb 12, 2015 at 9:15
  • so did you try to put rc.local in /etc/rc.d/ and create symlink to it in /etc/ ?
    – taliezin
    Commented Feb 12, 2015 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
    Commented Feb 12, 2015 at 9:30
  • a bit strange but is there an 'S' script for local in the runlevel you are booting into?
    – taliezin
    Commented Feb 12, 2015 at 9:50
  • What's a 'S' script? Sorry... I'm at runlevel 3
    – lppier
    Commented Feb 12, 2015 at 9:52
4

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
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .