systemctlサービスが起動しない

systemctlサービスが起動しない

RaspBerryPi プロジェクト用のサービスを作成しました。起動しても何も起こりません。systemctl status sb.service次の結果が返されます:

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

sb.サービス:

[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 ""

関連情報