1

I have a SysV init script on Fedora 18. Fedora 18 uses systemd (and apparently, there is no way to switch back to SysV).

My script requires the network to be ready.

<edit> That is, I must be able to reach another host on the network via ping by the time this script is run. </edit>

Currently, at the time the script runs, the network is not ready. How can I make sure that my SysV init script runs after the network is up?

The beginning of my script looks like this:

#!/bin/bash
#
# chkconfig: 345 99 01
# description: starts the xyz boot service
mfichman
  • 11
  • 2

1 Answers1

0

"First, catch your hare …"

First, you have to define what "network is ready" means. It's not simple, and your definition may be quite different to someone else's. Your question, of course, provides zero inkling of what your particular idea of "network is ready" happens to be.

When you've defined that, the rest is a simple matter of writing a unit file to replace your old System V shell script, which is a good idea anyway, and adding the necessary After=whatever (and probably Wants=whatever as well) to the unit. The hard part is the whatever, which depends from what you think "network is up" is.

When you've written your unit file, you might care to donate it to the world, making it one less unit file for the world to write.

JdeBP
  • 27,556
  • 1
  • 77
  • 106