How to configure startup scripts in Linux

Sometimes we need run custom scripts on the server statrtup. This article explains the steps to configure custom scripts to run during the server startup.

Step1: Create the script.

Here we are taking one shell script with file name "" as example.

echo `date` > /var/log/script.log

Step2: Assign execute permission to the script.

#chmod 755

Step3: Assign execute permission to the file '/etc/rc.d/rc.local' for the proper functioning.

#chmod 755 /etc/rc.d/rc.local

Step4: Update the full path to the script as the last line of the file '/etc/rc.d/rc.local'.

That's all….

Leave a Reply