notandy/ympd

How to autostart ympd using systemd?

taudac opened this issue · 3 comments

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
  1. What distro are you running?
  2. What's the output of journalctl -u ympd.service?

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?

Works for me too, same steps.