I am running Ubuntu 16.04.3.
I have configured that a docker container sends email using the host's smtp (postfix). In order for this to work, I have to add the docker network to postfix's main.cf file. Problem is that postfix starts before docker and throws an error about the network not being there, which is true because docker.service did not start yet, and therefore ignores it.
If postfix had a native systemd service unit file, I would just make it require docker.service, but postfix has SysV script, which systemd translates into service unit during boot.
Question is, how can I make postfix depend on docker being started? Or to put it more generically, how can i make a service which does not have a native systemd service unit file depend on a service that does have one.
I did see the couple of "keywords" I can use in the SysV script:
### BEGIN INIT INFO # Provides: my-service # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop service my-service # Description: my-service blah blah ... ### END INIT INFO
and there is an $all keyboard, which according to documentation, should mark this service as being started after everything else, but is this "everything else" all the systemd services or services that only have sysV scripts?
Setting $all to Required-Start for postfix SysV did not fix my issue.