Search code examples
fedorasysvsystemd

I have a SysV init script on Fedora 18. How can I make it start after the network is ready?


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. 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

Solution

  • OK, after trying several things, I tried adding an LSB header:

    ### BEGIN INIT INFO
    # Required-Start: $network $local_fs $named
    # Default-Start: 3 4 5
    # Default-Stop: 0 1 2 6
    # Short-Description: Starts/stops the foo service
    # Description: Starts/stops the foo service
    ### END INIT INFO
    

    This worked! The script now runs after the network is initialized. I guess the systemd implementation reads the LSB header.