Shouldn’t following command run myScript only at the runlevel 2. I noticed it executes at reboot too. I wanted to run it only and only at startup.
update-rc.d myScript start 01 2 . stop 01 0 1 6 .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s right. You need to check the first argument (start, stop, etc.) passed to your script to decide whats happening. It is explained in Debian Policy Manual ‘9.3.2 Writing the scripts’ section.
Or alternatively you can run your script just by placing it in /etc/init.d/rc.local file or do not include any stop levels in your update-rc.d.