오류를 확인한 후 사용하세요.journalctl -u raspotify --since=yesterday | grep ERROR
Dec 26 22:50:11 raspberrypi librespot[3024]: [2020-12-26T21:50:11Z ERROR librespot] Could not connect to server: failed to lookup address information: Temporary failure in name resolution
다음을 사용하여 수동으로 다시 시작합니다.systemctl restart raspotify
오류 발생 시 서비스를 자동으로 다시 시작하려면 서비스에서 무엇을 변경해야 합니까?
cat /lib/systemd/system/raspotify.service:
[Unit]
Description=Raspotify
After=network.target
[Service]
User=raspotify
Group=raspotify
Restart=always
RestartSec=10
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -m 0755 -p /var/cache/raspotify ; /bin/chown raspotify:raspotify /var/cache/raspotify
Environment="DEVICE_NAME=raspotify (%H)"
Environment="BITRATE=160"
Environment="CACHE_ARGS=--disable-audio-cache"
Environment="VOLUME_ARGS=--enable-volume-normalisation --linear-volume --initial-volume=100"
Environment="BACKEND_ARGS=--backend alsa"
EnvironmentFile=-/etc/default/raspotify
ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS
[Install]
WantedBy=multi-user.target
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wl*", RUN+="/usr/bin/iw dev $name set power_save off"