부팅시 systemd 서비스가 시작되지 않습니다

부팅시 systemd 서비스가 시작되지 않습니다

Debian Jessie 상자를 다시 시작할 때마다 NZBget이 시작되지 않습니다. 이미 활성화되어 있습니다sudo systemctl enable nzbget

만약 내가한다면:

$ sudo systemctl status nzbget
* nzbget.service - NZBGet
Loaded: loaded (/etc/systemd/system/nzbget.service; enabled)
Active: inactive (dead) since Sat 2016-02-20 12:14:55 GMT; 1min 15s ago
Process: 381 ExecStop=/opt/nzbget/nzbget -Q (code=exited,status=0/SUCCESS)
Process: 263 ExecStart=/opt/nzbget/nzbget -D (code=exited, status=0/SUCCESS)

그렇게 하면 sudo system start nzbget시작됩니다.

서비스 파일입니다sudo nano /etc/systemd/system/nzbget.service

[Unit]
Description=NZBGet
After=network.target
RequiresMountsFor=/<pathtomount>

[Service]
User=osmc
Group=osmc
ExecStart=/opt/nzbget/nzbget -D
ExecStop=/opt/nzbget/nzbget -Q

# process will demonize and parent return ok
Type=forking
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure

[Install]
# Needed to run nzbget at boot
WantedBy=multi-user.target

이 문제에 대한 제안 사항

 -- Logs begin at Sat 2016-02-20 12:31:40 GMT, end at Sun 2016-02-21 10:53:14 GMT. --
Feb 20 12:31:43 osmc nzbget[279]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[279]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[279]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[279]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[279]: nzbget.conf(70): Invalid value for option "TempDir" (/home/osmc/Downloads/tmp/): could not read information for dir
Feb 20 12:31:43 osmc nzbget[279]: nzbget.conf(67): Invalid value for option "QueueDir" (/home/osmc/Downloads/queue/): could not read information for 
Feb 20 12:31:43 osmc nzbget[279]: nzbget.conf(61): Invalid value for option "NzbDir" (/home/osmc/Downloads/nzb/): could not read information for dire
Feb 20 12:31:43 osmc nzbget[391]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[391]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[391]: /home/osmc/Downloads/nzbget.log: No such file or directory
Feb 20 12:31:43 osmc nzbget[391]: nzbget.conf(70): Invalid value for option "TempDir" (/home/osmc/Downloads/tmp/): could not read information for dir
Feb 20 12:31:43 osmc nzbget[391]: nzbget.conf(67): Invalid value for option "QueueDir" (/home/osmc/Downloads/queue/): could not read information for 
Feb 20 12:31:43 osmc nzbget[391]: nzbget.conf(61): Invalid value for option "NzbDir" (/home/osmc/Downloads/nzb/): could not read information for dire
Feb 20 12:31:43 osmc nzbget[391]: Unable to send request to nzbget-server at 127.0.0.1 (port 6789)

답변1

위의 편집을 참조하세요. [unit] 섹션에 다음이 필요합니다. RequiresMountsFor=/<pathtomount>

이제 모든 것이 잘 작동하고 외장 드라이브를 장착한 후 서비스가 시작됩니다.

관련 정보