I have a Oracle Linux 6.3 system on which I would like to run a command when the machines starts up before any other services are started. The reason for this is to try and work around a bug in RHEL 6.
I know that rc.local exists, but that is run after all other services have been run and is therefore too late.
Here is the order in which things are currently run:
- Oracle 11g (fails due to RHEL bug)
- One or more things that depend on Oracle (fail due to no Oracle)
rc.local(too late to help)
Ideally I would like to do it this way:
- Command which works around bug.
- Oracle
- One or more things that depend on Oracle.
Is it possible to do such a thing?
Here are some options I have thought of so far that I would like to avoid as they add complexity and/or are just a bit nasty:
- Creating a custom service that is run before everything else.
- Adding the command to
rc.localfollowed by calls toservice <x> startfor all the things that didn't start up.