

Method – 4: Configure Startup Scripts using Startup Applications respawn – defines auto-start in terms of process crash.fork – detaches the service and makes it run in the background.stop – exits the service whenever the system reaches a different run level.


Upstart doesn’t rely on arcane scripts for loading services on startup and offers a flexible event-driven system. The Upstart daemon provides immense customization and reduces many of the problems associated with system V init. Method – 3: Configure Startup Commands using Upstart Else init will not start your application after the boot process. The S stands for start, and you need to add it at the beginning f your script. Note that we are adding an S followed by the number 70. Now that we have symlinked the script, we need to rename it according to the rc naming scheme. You may need to change your run level based on your requirements. We are symlinking our test script to run level 2 since it’s the default multi-user run level. The number followed by rc denotes the run level. Note that there are several rcN.d directories in Linux. You can do this by using the following command. You need to create a symlink for this script into the rc2.d directory. Now, copy it into the init.d directory using the following simple command. You can add execution permission to a script called test.sh using the following command. But first, make sure the script is executable. One simple method of running jobs at reboot is to place them in the / directory.

Method – 2: Configure Linux Startup Scripts using init And, if your script uses environment variables, you must include those at your crontab. This is usually the case for most Linux distributions. First, the CRON daemon must be running after your system reboots. However, if you want to use CRON for scheduling startup scripts, you need to take care of two things. To edit the crontab for your user, use the below command in your favorite terminal emulator. Simply edit your crontab and add the above line. The directive tells CRON to run the custom script after a boot/reboot operation. You can run it after each system restart by adding the following line to your crontab. For example, assume you have a test script called test.sh. We can easily create a startup job using CRON. Method – 1: Configure Startup Scripts using CRONĬRON is a simple but powerful job scheduler that can run certain tasks at system reboot.
