TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinux

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 "script.sh" as example.

#!/bin/bash
echo `date` > /var/log/script.log

Step2: Assign execute permission to the script.

#chmod 755 script.sh

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