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.local followed by calls to service <x> start for all the things that didn't start up.
  • In what way it adds unnecessary complexity? It's the shortest path to what you want to do. – schaiba Feb 7 '13 at 11:16
  • It's a single command I want to run (a remount). Adding a service seems pointless overhead. Some background that I didn't add is that what I'm creating is an image for a system that will be deployed in multiple locations and managed by people who aren't me. – Burhan Ali Feb 7 '13 at 11:19
  • @schaiba Also, is it the shortest path? That's part of what I'm trying to work out here. – Burhan Ali Feb 7 '13 at 11:26
  • I'd hack it into Oracle's startup script, as a last resort. Check the script doing the original mount, maybe that one (or /etc/fstab, or the automount configuration) is broken. Check if the problem really is that Oracle is being started too early (perhaps this is fixed in another script that either isn't run or runs too late). In any case, RHEL + Oracle is one of the premier combinations, I'd be surprised if nobody else has tripped over this (unless your setup is rather bizarre). – vonbrand Feb 7 '13 at 13:54
  • I ended up just doing mount -o remount /dev/shm in the Oracle startup script (with a comment point to the bugzilla entry) as I didn't find a better option. Thanks for the suggestion @vonbrand – Burhan Ali Aug 24 '13 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.