使用 /usr/local/bin/mpd 而不是 /usr/bin/mpd

使用 /usr/local/bin/mpd 而不是 /usr/bin/mpd

我想运行安装在 /usr/local/bin 中的修补过的 mpd。通常它通过以下方式启动: sudo service mpd start

在 /etc/init.d/mpd 中将:更改 DAEMON=/usr/bin/mpdDAEMON=/usr/local/bin/mpd 无效:服务仍然启动 /usr/bin/mpd。

我注意到 /lib/systemd/system/mpd.service 文件并尝试更改其

ExecStart=/usr/bin/mpd --no-daemon $MPDCONFExecStart=/usr/local/bin/mpd --no-daemon $MPDCONF

但现在 mpd 服务无法启动。

以下是 systemctl status mpd 的输出

● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit) since jeu. 2016-04-21 11:04:26 CEST; 2s ago
  Process: 26778 ExecStart=/usr/local/bin/mpd --no-daemon $MPDCONF (code=exited, status=1/FAILURE)
 Main PID: 26778 (code=exited, status=1/FAILURE)

avril 21 11:04:25 lago systemd[1]: Started Music Player Daemon.
avril 21 11:04:26 lago mpd[26778]: cmdline: No configuration file found
avril 21 11:04:26 lago systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
avril 21 11:04:26 lago systemd[1]: mpd.service: Unit entered failed state.
avril 21 11:04:26 lago systemd[1]: mpd.service: Failed with result 'exit-code'.
avril 21 11:04:26 lago systemd[1]: mpd.service: Start request repeated too quickly.
avril 21 11:04:26 lago systemd[1]: Failed to start Music Player Daemon.
avril 21 11:04:26 lago systemd[1]: mpd.service: Failed with result 'start-limit'.

我检查: sudo /usr/local/bin/mpd --no-daemon /etc/mpd.conf 从命令行工作。

我搞不懂这个服务配置。我应该修改什么?

答案1

事实证明,改为$MPDCONF可以/etc/mpd.conf解决问题。奇怪的是,这条线在使用时工作正常/usr/bin/mpd

相关内容