【发布时间】:2011-01-14 20:28:10
【问题描述】:
我想在 python 脚本中运行一些命令
import fcntl
KDSETLED = 0x4B32
SCR_LED = 0x01
console_fd = os.open('/dev/console', os.O_NOCTTY)
fcntl.ioctl(console_fd, KDSETLED, SCR_LED)
我已经为/dev/console 设置了a+rw,但是当我从普通用户运行脚本时:
fcntl.ioctl(console_fd, KDSETLED, SCR_LED) IOError: [Errno 1] 操作 不允许
如果我需要从普通用户运行该脚本,我该怎么办?
【问题讨论】: