How to add an automatic startup program at boot through systemd in linux Ubuntu

This article describes how to create a web server in Linux system, and set up Systemd to automatically start and manage the operation of the web server.

Set up an Echo server

First write a simple echo server in Python and store it in /opt/ :

 #!/usr/bin/env python3  import socket  # create socket serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  # Bind the local 9000 connection port serv.bind(( ' ' , 9000 ))  # Start accepting client connections serv.listen()  while True :      # Accept client connections

The post linux Ubuntu Adds an autostarter method on boot via systemd first appeared on Lenix Blog .

This article is reprinted from
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.