0

I have script and I want it to run when my system reboot. I put the script in /etc/init.d/superscript

and add script to end of the rc.local

bash /etc/init.d/superscript
# i also test this
source /etc/init.d/superscript

but nothing happened when I rebooted the system. The file script have 755 perm.

What is the problem?

1
  • Hi Arash, can you please try using "bash /etc/init.d/superscript >>/tmp/superscript.log 2>&1" in your rc.local and check the logfile /tmp/superscript.log after boot. Also the content of your superscript might help for seeing what goes wrong :) Commented Jan 26, 2019 at 7:46

1 Answer 1

0

You have to keep the script in /etc/rc.d/rc3.d/superscript and make symlink with /etc/init.d/superscript.

/etc/rc.d/rcX.d directory contain scripts which are execute at boot time or at runlevel changing.

  • If script name start with S it means script start at boot time.
  • If script name start with K it means script stop/kill at boot time.

If you want to start superscript in runlevel 3 then create link with S.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.