我的 Ubuntu 系统上有一张dvb 卡,并编写了一个显示 dvb 调谐器gnome-terminal
的 bash 文件,并将 bash 文件放入启动中以在用户登录系统时运行脚本,如下所示:
#!/bin/bash
# Bash script to show list of bvb tuner
gnome-terminal --title="list of bvb tuners" -x bash -c "lsdvb; read line" &
gnome-terminal --title="Tuner 4:" -x bash -c "dvblast -a 4 -f 12596000 -s 27500000 -v 13 -c Tuner4.cfg -i 1 ; read line" &
lsdvb来自 dvb-app 存储库的命令,显示 Linux 中的 dvb 调谐器列表,dvblast是用于广播直播电视的程序。
当我在服务器上有 1 个 dvb 卡时,一切正常...当我将第二个 dvb 卡添加到服务器并重新启动系统时,bash 文件启动但看到以下运行错误dvblast
:
这对于lsdvb
:
如果使用登录gnome-terminal
并sudo -s
手动运行 bash 文件,它的工作正常。
当移除第二张卡时,bash 文件在启动时工作正常。
我strace
输入命令行并查看此日志lsdvb
:
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
lsdvb: Simple utility to list PCI/PCIe DVB devices
Version: 0.0.4
Copyright (C) Manu Abraham
+++ exited with 0 +++
这个日志用于dvblast
:
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
DVBlast 2.2 (release)
warning: restarting
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
open("/usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so", O_RDONLY|O_CLOEXEC) = 3
debug: using linux-dvb API version 5
open("/dev/dvb/adapter3/frontend0", O_RDWR|O_NONBLOCK) = -1 ENOENT (No such file or directory)
error: opening device /dev/dvb/adapter3/frontend0 failed (No such file or directory)
+++ exited with 1 +++
谁能知道当第二张卡添加到 bash 文件需要特殊权限的服务器时发生了什么?