linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333

推推 grbl 3年前 (2023-01-29) 261次浏览
打开
l29ah 开了这个issue 2017 年 9 月 19 日 · 3条评论
打开

linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied#333

l29ah 开了这个issue 2017 年 9 月 19 日 · 3条评论

注释

linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333
贡献者

9d99a30

$ linuxcnc -v
/usr/bin/linuxcnc: line 123: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 222: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 232: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 233: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 234: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 235: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 236: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 237: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 238: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 239: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 240: /dev/fd/1: Permission denied
/usr/bin/linuxcnc: line 241: /dev/fd/1: Permission denied
LINUXCNC - 2.8.0~pre1

你为什么不使用通常的 shell“to-fd”重定向echo foo >&1呢?

linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333

我无法重现此问题。我尝试了几个旧的 2.7 版本和 master 的当前提示 ( 9d99a30 ),所有这些都是由 debs 从http://www.linuxcnc.org或从 buildbot 安装的,在 Wheezy/i386/rtai 和 Stretch/rt-preempt/amd64 上。我尝试运行“linuxcnc -v”、“sudo linuxcnc -v”和“sudo su -”,然后是“linuxcnc -v”,它们都启动了配置选择器,但没有打印任何“权限被拒绝”错误。

您在什么平台(发行版、内核版本、架构)上运行测试?

您是自己构建 linuxcnc 还是安装我们的 debian 软件包?

导致此输出的命令顺序是什么?

linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333
贡献者作者
l29ah 评论了 2017 年 9 月 20 日 通过电子邮件
linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333
成员

该脚本这样做是为了让我们可以在运行时决定是在 stdout/stderr 上显示输出,还是将其存储在文件中。欢迎补丁,但我们不能在此过程中破坏现有功能。

基于这篇来自 的文字bash(1),我很惊讶有一个问题:

       Bash handles several filenames specially when they are used in redirec‐
       tions, as described in the following table.  If the operating system on
       which bash is running provides these special files, bash will use them;
       otherwise it will emulate them internally with the  behavior  described
       below.

              /dev/fd/fd
                     If  fd  is  a valid integer, file descriptor fd is dupli‐
                     cated.
              /dev/stdin
                     File descriptor 0 is duplicated.
              /dev/stdout
                     File descriptor 1 is duplicated.
              /dev/stderr
                     File descriptor 2 is duplicated.
              /dev/tcp/host/port
                     If host is a valid hostname or Internet address, and port
                     is  an integer port number or service name, bash attempts
                     to open the corresponding TCP socket.
              /dev/udp/host/port
                     If host is a valid hostname or Internet address, and port
                     is  an integer port number or service name, bash attempts
                     to open the corresponding UDP socket.

       A failure to open or create a file causes the redirection to fail.

但我想在这种情况下/dev/fd是存在的,但语义是这样的,它实际上不像dup ()ing 现有的文件描述符。:-/

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
项目

还没有

发展

没有分支机构或拉取请求

3人参加
linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333linuxcnc 不喜欢从su和朋友处运行:/dev/fd/1: Permission denied #333

喜欢 (0)