Re: Autostart command after network is available (usbip)
Christian Britz wrote:
> I want to know how I can execute a command as root once after the
> network is available.
>
> I activated usbipd on my home server and want to attach the client
> automatically at boot. Manually attaching it works already.
>
> The command to be executed as root on the client is:
> usbip attach -r hostname -b n-n.n
>
> Is this to be done via systemd? I was able to create a service on the
> server for the daemon, but failed to do so for the client.
> I also tried the root crontab using the @reboot timer, this failed
> probably because of the network is not available at execution time.
The normal methods for something that
- should run once
- as root
- after boot
- with a dependency on the network
would be:
- an init.d/ script with a dependency on network
- a systemd unit with a dependency on network
- an /etc/network/interfaces.d/ script run every time a
particular interface is brought up (i.e. post-up).
-dsr-
Reply to: