Service Auto-Start in Linux Environment

This article utilizes systemctl to control various services to achieve auto-start on boot!!!

I have pre-written some service auto-start modules in my compressed package; you can modify some content based on the scheme below. The attachment is at the bottom of the document.

Taking OA as an example

1: Place the resin.service attachment in the /etc/systemd/system path and modify the corresponding configuration.

[Unit]  Description=Resin  After=network.target  [Service]  ExecStart=/opt/WEAVER/Resin4/bin/startresin.sh  # This refers to the path of the resin start command, change it to the actual one  ExecStop=/opt/WEAVER/Resin4/bin/stopresin.sh    ## This refers to the path of the resin stop command, change it to the actual one  LimitFSIZE=infinity  LimitCPU=infinity  LimitAS=infinity  LimitNOFILE=infinity  LimitMEMLOCK=infinity  LimitNPROC=65535  TasksMax=infinity  PrivateTmp=true  [Install]  WantedBy=multi-user.target

2: Reload the system services <span>systemctl daemon-reload</span>

Configure OA to start automatically on boot <span>systemctl enable resin</span>

At this point, the configuration for the OA service auto-start has been completed.

Leave a Comment