我在我的Ubuntu系统上有一张dvb卡,写了一个bash文件来显示gnome终端中的dvb tuner,并将该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
,则会出现以下错误:
如果使用sudo -s
在gnome-terminal
中登录,并手动运行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 文件发生了什么问题有人知道吗?