Answer the question
In order to leave comments, you need to log in
How to start service in linux after raising network?
There is a service in /etc/init.d/myservice, it starts before the network is up, how to make the service start after the network is up?
Clarification, 2 providers are configured, one wired second modem. The wired one rises quickly, it takes 40 seconds to start the modem.
Answer the question
In order to leave comments, you need to log in
put the start of the service in /etc/network/if-up.d
or in the cron
or in the service script, before starting the cycle waiting for the network to turn on or for the ping to pass to some server.
with systemd a couple more options are possible.
etc.
choose.
(/etc/systemd/system/test.service)
[Unit]
Description=test service
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/root/test.script
[Install]
WantedBy=multi-user.target
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question