Supervisor服务无权访问音频设备(“设置open_pcm时出错:没有这样的文件或目录”)

问题描述 投票:0回答:1

我正在使用Supervisor来妖魔化Python / Liquidsoap应用程序。当我从命令行启动应用程序时,一切正常。

[当我使用supervisorctl运行相同的应用程序时,尝试访问音频设备时Liquidsoap实现失败:

[lineout:3] Using ALSA 1.1.8.
[clock.wallclock_alsa:2] Error when starting output lineout: Failure("Error while setting open_pcm: No such file or directory")!

USB音频接口可通过ALSA访问。 Supervisor配置具有正确的用户设置,并且使用该用户启动服务:

[program:aura-engine]
user = engineuser
directory = /opt/aura/engine
command = /opt/aura/engine/run.sh engine

priority = 666
autostart = true
autorestart = true
stopsignal = TERM

redirect_stderr = true
stdout_logfile = /var/log/aura/engine-core-stdout.log
stderr_logfile = /var/log/aura/engine-core-error.log

使用Supervisord时是否还涉及其他硬件许可问题?

python systemd supervisord alsa liquidsoap
1个回答
0
投票

事实证明,使用root启动应用程序(Supervisor配置中的root用户,但也以root身份启动supervisord,再加上sudo supervisorctl start...启动服务)成功授予了对音频硬件的访问权限。但是以root身份运行该应用程序不是一种选择。这也会由主管发出警告。

然后我将配置返回到所需的engineuser,并使用sudo重新加载了配置:

sudo supervisorctl reload

现在,突然之间,我可以在没有root / sudo的情况下启动应用程序,并且可以完全访问音频硬件:

supervisorctl start aura-engine
© www.soinside.com 2019 - 2024. All rights reserved.