简体   繁体   中英

Automatically starting a UDP server at Ubuntu startup

I want to start a UDP server in Ubuntu as soon as the computing board wakes up from sleep mode. The UDP server just listens at a port for a UDP packet which is expected to receive from a UDP client. How do I make UDP server start as soon as the board wakes up from the sleep/standby mode?

I'm missing a couple of details but here are a couple of options:

  1. Start the server using a startup script in /etc/init.d (see https://askubuntu.com/questions/34342/custom-daemon-script-works-but-does-not-run-at-boot-startup ). This way, the server will be running before the machine is put to sleep and will be restores (together with the rest of the system) as the machine wakes up.

  2. You can also run scripts after RESUME . Here, you need to make sure that your server is stopped when the machine is put to sleep or you need to check whether the server is already running (it will fail to connect to the port if another version is already running).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM