簡體   English   中英

Systemd不激活服務?

[英]Systemd does not activate service?

我需要在 systemd 上運行一個服務,因為它沒有激活? 由於我遵循文檔的建議而發生這種情況的原因,以下是代碼:

服務代碼:

# Contents of /etc/systemd/system/quark.service
[Unit]
Description=Quark
After=network.target

[Service]
Type=simple
User=cto
ExecStart=/usr/local/bin/python3.9 /var/net/
Restart=always

[Install]
WantedBy=multi-user.target

狀態代碼:

● quark.service - Quark
   Loaded: loaded (/etc/systemd/system/quark.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Mon 2021-06-21 15:20:34 UTC; 8s ago
  Process: 1467 ExecStart=/usr/local/bin/python3.9 /var/net/ (code=exited, statu
 Main PID: 1467 (code=exited, status=1/FAILURE)

Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Main process exited, code=e
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Service RestartSec=100ms ex
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Scheduled restart job, rest
Jun 21 15:20:34 webstrucs systemd[1]: Stopped Quark.
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Start request repeated too 
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: Failed to start Quark.

ExecStart應該是要執行的命令:

系統手冊頁:

ExecStart=

Commands with their arguments that are executed when this service is started.

本節:

ExecStart=/usr/local/bin/python3.9 /var/net/

應該:

ExecStart=/usr/local/bin/python3.9 path_to_python_script.py

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM