systemctl 서비스가 시작되지 않습니다

systemctl 서비스가 시작되지 않습니다

RaspBerryPi 프로젝트를 위한 서비스를 만들었습니다. 시작하면 아무 일도 일어나지 않습니다. systemctl status sb.service다음을 반환합니다.

Failed to start RPI-sound board.
Unit entered failed state.
Failed with result 'exit-code'.

SBS.서비스:

[Unit]
Description=RPI-sound board
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/home/pi/Desktop/RPSB/RpiSoundBoard.sh
User=pi

[Install]
WantedBy=multi-user.target

실행될 것으로 예상되는 파일은 다음과 같습니다.여기서 호스팅됨. 내가 직접 실행하면 잘 실행됩니다. 내 서비스에서 더 많은 출력을 얻거나 이 문제를 해결하려면 어떻게 해야 합니까?

답변1

에서 문제를 발견했습니다 /var/log/syslog.

    Traceback (most recent call last):
    File "/home/pi/Desktop/RPSB/soundPlayer.py", line 1, in <module>
    from pynput.keyboard import Key, Listener
    File "/home/pi/.local/lib/python3.5/site-packages/pynput/__init__.py", line 40, in <module>
    from . import keyboard
    File "/home/pi/.local/lib/python3.5/site-packages/pynput/keyboard/__init__.py", line 49, in <module>
    from ._xorg import KeyCode, Key, Controller, Listener
    File "/home/pi/.local/lib/python3.5/site-packages/pynput/keyboard/_xorg.py", line 39, in <module>
    from pynput._util.xorg import (
    File "/home/pi/.local/lib/python3.5/site-packages/pynput/_util/xorg.py", line 40, in <module>
    _check()
    File "/home/pi/.local/lib/python3.5/site-packages/pynput/_util/xorg.py", line 38, in _check
    display = Xlib.display.Display()
    File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
    File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
    File "/home/pi/.local/lib/python3.5/site-packages/Xlib/protocol/display.py", line 84, in __init__
    name, protocol, host, displayno, screenno = connect.get_display(display)
    File "/home/pi/.local/lib/python3.5/site-packages/Xlib/support/connect.py", line 73, in get_display
    return mod.get_display(display)
    File "/home/pi/.local/lib/python3.5/site-packages/Xlib/support/unix_connect.py", line 76, in get_display
    error.DisplayNameError(display)
    Xlib.error.DisplayNameError: Bad display name ""

관련 정보