Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #245100

Re: Autostart command after network is available (usbip)

From Dan Ritter <dsr@randomstring.org>
Newsgroups linux.debian.user
Subject Re: Autostart command after network is available (usbip)
Date 2022-02-08 16:20 +0100
Message-ID <DOArD-qaO-1@gated-at.bofh.it> (permalink)
References <DOzYB-pL9-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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-

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Autostart command after network is available (usbip) Christian Britz <cbritz@t-online.de> - 2022-02-08 15:50 +0100
  Re: Autostart command after network is available (usbip) Dan Ritter <dsr@randomstring.org> - 2022-02-08 16:20 +0100
  Re: Autostart command after network is available (usbip) Greg Wooledge <greg@wooledge.org> - 2022-02-08 16:50 +0100
    Re: Autostart command after network is available (usbip) Christian Britz <cbritz@t-online.de> - 2022-02-08 17:50 +0100
      Re: Autostart command after network is available (usbip) Greg Wooledge <greg@wooledge.org> - 2022-02-08 17:50 +0100
        OT: Network-Manager Christian Britz <cbritz@t-online.de> - 2022-02-08 18:00 +0100
      Re: Autostart command after network is available (usbip) Christian Britz <cbritz@t-online.de> - 2022-02-08 17:50 +0100
        Re: Autostart command after network is available (usbip) Andrei POPESCU <andreimpopescu@gmail.com> - 2022-02-09 15:50 +0100
      Re: Autostart command after network is available (usbip) Andy Smith <andy@strugglers.net> - 2022-02-09 07:10 +0100
        Re: Autostart command after network is available (usbip) 황병희 <soyeomul@doraji.xyz> - 2022-02-09 13:00 +0100

csiph-web