Start Script on system reboot

Hi,
I have the following script that looks for a certain file and then executes the start.sh file. How can i make this process to kick when the box reboots. Please advice

if [ -f /u01/EnvironmentStartup/Foundationstarted.txt ]; then
    /u01/Essbase/Oracle//Middleware/user_projects/epmsystem7/bin/start.sh;
    rm /u01/EnvironmentStartup/Foundationstarted.txt;
 fi

Thanks

It will depend of your operating system... Which you have said nothing...

Thanks Vbe and my apologies
Linux x86_64 GNU/Linux

The script should me a bit more complete than that to be used at boot, for it should be able to be started - and stopped also....
Then once that script works perfectly you should put in in /etc/init.c and create symbolic links to the proper init level you want the script to start and do the same for stop...
the file should use an argument which is either stop or start
Go and have a look how it is done on your system!

Would such init scripts still work if it is a systemd system?

Such a service is 'easy' written, have a look at some services in:

  • /etc/systemd/system/ (files here are accessed using systemctl )
  • /lib/systemd/system/ (files here are copied to the /etc/systemd/system folder)

hth

oracle has a statup/shutdown file called oratab. If you could tell us what your OS is we could probably tell you where it is, minus that the find command is your friend.

Read up on oratab syntax first - you are allowed to call ONE shell script per db.
The file is used both for startup & shutdown. If you have oracle installed you probably have the file. A companion file is oraenv.

Oratab - Oracle FAQ

PS your file should be /etc/oratab

Thanks Jim,
There are start and stop files. I have this process which needs to startup a service once the "Foundationstarted.txt" exists. The .sh script should come into play as soon as the system reboots. so whenever the linux (gnu/linux) box is rebooted this ".sh" should be executed and this will keep looking for the "Foundationstarted.txt" file every minute until it finds it and then once it finds it restart the Essbase services.

Since different ways of boot and startup exist within the GNU/Linux ecosystem, I suggest that you provide instead the distribution name and version that you are using. Currently, we are in the middle of a state of change, even between versions of the same distribution.

Why not cron's "@reboot" specifier?