notandy / ympd

Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
http://www.ympd.org
GNU General Public License v2.0
515 stars 143 forks source link

How to autostart ympd using systemd? #109

Open taudac opened 8 years ago

taudac commented 8 years ago

What I have done:

sudo cp ~/src/ympd/contrib/ympd.service /usr/lib/systemd/system/
sudo systemctl enable ympd.service
sudo systemctl start ympd.service

Starting ympd fails with:

Job for ympd.service failed. See 'systemctl status ympd.service' and 'journalctl -xn' for details.

systemctl status ympd returns:

● ympd.service - ympd server daemon
   Loaded: loaded (/usr/lib/systemd/system/ympd.service; enabled)
   Active: **failed** (Result: resources)

Note: The platform is Raspberry Pi 2 (kernel: rpi-4.3.y)

3onyc commented 8 years ago
  1. What distro are you running?
  2. What's the output of journalctl -u ympd.service?
taudac commented 8 years ago

I am running Raspbian Jessie.

I have fixed the issue in the meantime somehow. I have used the following steps (if I recall correctly):

  1. sudo cp contrib/ympd.service /etc/systemd/system/
  2. sudp cp contrib/ympd.default /etc/default/ympd
  3. ympd has been installed to /usr/local/bin, so, in the file ympd.service, I have changed ExecStart=/usr/bin/ympd to ExecStart=/usr/local/bin/ympd.
  4. To ensure that ympd is started after mpd, I have added mpd.service to the After and Requires options in ympd.service.
  5. sudo systemctl daemon-reload
  6. sudo systemctl enable ympd.service
  7. sudo systemctl start ympd.service

Does that make sense? Shouldn't make install do something like that?

dewi-ny-je commented 6 years ago

Works for me too, same steps.