簡體   English   中英

通過systemd啟動瓶子web服務器?

[英]Starting bottle web server through systemd?

我正在嘗試啟動我使用systemd編寫的瓶子web應用程序。 我使用以下內容創建了文件/etc/systemd/user/bottle.service

[Unit]
Description=Bottled fax service
After=syslog.target

[Service]
Type=simple
User=fax
Group=fax
WorkingDirectory=/home/fax/bottlefax/
ExecStart=/usr/bin/env python3 server.py
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=2

[Install]
WantedBy=bottle.target

但是,當我嘗試啟動它時,它會失敗,並在journalctl打印:

Jun 10 17:33:31 nano systemd[1]: Started Bottled fax service.
Jun 10 17:33:31 nano systemd[1]: Starting Bottled fax service...
Jun 10 17:33:31 nano systemd[2380]: Failed at step GROUP spawning /usr/bin/env: No such process
Jun 10 17:33:31 nano systemd[1]: bottle.service: main process exited, code=exited, status=216/GROUP
Jun 10 17:33:31 nano systemd[1]: Unit bottle.service entered failed state.
Jun 10 17:33:31 nano systemd[1]: bottle.service failed.

我該怎么解決這個問題?

編輯:

更改為/usr/bin/python3因為其他人建議導致相同的錯誤(雖然已更改文件):

Jun 10 18:43:48 nano systemd[1]: Started Bottled fax service.
Jun 10 18:43:48 nano systemd[1]: Starting Bottled fax service...
Jun 10 18:43:48 nano systemd[2579]: Failed at step GROUP spawning /usr/bin/python3: No such process
Jun 10 18:43:48 nano systemd[1]: bottle.service: main process exited, code=exited, status=216/GROUP
Jun 10 18:43:48 nano systemd[1]: Unit bottle.service entered failed state.
Jun 10 18:43:48 nano systemd[1]: bottle.service failed.

我會評論但我不能:/

你嘗試過絕對路徑嗎?

ExecStart=/usr/bin/python3 /path/to/your/server.py

這是我在這里看到的唯一問題。

此錯誤的另一個可能原因是,如果您通過運行adduser --system創建了系統用戶,並且尚未創建關聯組。

暫無
暫無

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

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