0
我有一個Ubuntu 16和systemd單元文件的奇怪問題。我有一個從本地文件系統讀取目錄的服務。該目錄是從環境變量中讀取的。現在,當我手動啓動服務時(如在ssh會話中),一切正常。但是,當我從下面的單元文件啓動服務時,該服務無法打開storage
目錄。我得到的錯誤是:could nog read contents of storage" message="open /srv/services/poddy/storage: no such file or directory
。當從systemd單元文件運行時,無法打開目錄
現在我的問題是:systemd類的「沙箱」服務?
[Unit]
Description=Poddy service
After=network.target
[Service]
Type=simple
User=myusername
Group=myusername
WorkingDirectory=/srv/services/poddy
ExecStart=/srv/services/poddy/poddy
Restart=always
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
Environment=PODDY_STORAGE="/srv/services/poddy/storage"
Environment=PODDY_PORT=8085
[Install]
WantedBy=multi-user.target