问题标签 [nfs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
4086 浏览

security - 运行在 PC 上的 IBM RDZ 如何访问大型机的文件系统?

我反复听到,虽然 NFS 样式的文件系统在 IBM 大型机上可用,但它们通常未启用,大概是为了将大型机相对于世界其他地方的安全风险降到最低。

鉴于我想制作基于 PC 的工具来处理大型机上的文件,这使得一个简单的问题(“打开 NFS 文件 '\mainframe\foo'”)变得更加困难;我可以依靠什么来在网络环境中提供文件系统访问?(Linux 系统通过 Samba 提供 NFS 几乎是标准的,所以这很容易)。

IBM 提供 Rational Developer for Z,这是 IBM COBOL 程序员使用的 Eclipse 变体。RDZ 似乎可以直接访问 IBM 大型机文件系统。他们用什么来做到这一点?为什么我不能使用它,如果是,它是什么?

0 投票
5 回答
33684 浏览

cron - 如何以与根 cronjob 不同的用户身份运行命令?

我似乎陷入了 NFS 限制和 Cron 限制之间。

所以我有 root cron(在 RHEL5 上)运行一个 shell 脚本,除其他外,需要通过 NFS 挂载 rsync 一些文件。并且 NFS 挂载上的文件由模式 700 的 apache 用户拥有,因此只有 apache 用户可以运行 rsync 命令——以 root 身份运行会产生权限错误(NFS 显然是一种罕见的情况,其中 root 用户是不是万能的?)

当我只想手动运行 rsync 时,我可以使用“sudo -u apache rsync ...”但是 sudo 在 cron 中没有工作——它说“sudo:抱歉,你必须有一个 tty 才能运行 sudo”。

我不想将整个脚本作为 apache 运行(即来自 apache 的 crontab),因为脚本的其他部分确实需要 root ——这只是一个需要作为 apache 运行的命令。而且我真的不希望更改文件的模式,因为这将涉及对其他应用程序的重大更改。

一定有办法从cron完成“sudo -u apache”??

谢谢!抢

0 投票
2 回答
2248 浏览

nfs - 如何恢复 .nfs 文件?

我一直在研究 Python 中的算法,我正在使用 Vim 来编辑这个文件。我打开它,做了一个保存,它会出现一个错误,就像它偶尔会做的那样:

“警告:您的文件无法保存!所有更改都将丢失!无法写入文件!”

由于这种情况偶尔会发生,我做了我通常做的事情,然后我点击了:q!退出而不写任何更改。没有伤害,没有犯规。当我查看我的文件时,一切都被删除了!一切!

我在办公室里闲聊,似乎 nfs 挂载已满,所以我无法保存任何内容。有一个巨大的脚本生成大量数据,这导致安装暂时满了。我相信 NFS 挂载来自 NetApp。我在当前目录中找到了 2 个文件。

一个是两天前最后保存的,一个是今天。它们的格式为:

.nfs.xxxxxxxxxxx

当我试图打开这个文件时,我看到我的一些代码,到处都是未知字符。显然,这必须是文件状态的二进制表示。

有没有办法从这个 NFS 挂载中恢复这个文件?如果 Emacs 有恢复这个文件的快捷方式,我会从 vim 切换到 Emacs!

0 投票
2 回答
19306 浏览

nfs - NFS + 硬链接?

我知道硬链接的一个条件是它们不能跨越文件系统。这是否适用于 NFS 挂载?鉴于以下目录结构,我能否在目录 A 中创建指向目录 B 中文件的硬链接?

例如,我想运行ln /root/B/file.txt /root/A/linkedfile.txt

0 投票
1 回答
1009 浏览

unix - (sun)RPC auth_unix

我正在实现我自己的 RPC 框架,并且大部分工作已经完成,但我需要一些帮助我如何验证 auth_unix?数据结构在http://www.faqs.org/rfcs/rfc1050.html 9.2 UNIX 身份验证中定义,但我应该如何验证用户?

0 投票
1 回答
1058 浏览

rpc - NFS 创建文件(覆盖)= 零大小?

我实现了 NFS 并且几乎完成了,但是RFC 第 3.3.8 节在其描述中说明了这一点:

UNCHECKED、GUARDED 和 EXCLUSIVE 模式之一。UNCHECKED 意味着应该在不检查同一目录中是否存在重复文件的情况下创建文件。在这种情况下,how.obj_attributes 是描述文件初始属性的 sattr3。GUARDED 指定服务器应在执行创建之前检查是否存在重复文件,如果存在重复文件,则应使用 NFS3ERR_EXIST 使请求失败。如果文件不存在,则按照 UNCHECKED 的描述执行请求。EXCLUSIVE 指定服务器遵循独占创建语义,使用验证器确保目标独占创建。在这种情况下可以不提供任何属性,因为服务器可以使用目标文件元数据来存储 createverf3 验证器。

所以如果 UNCHECKED 是模式的问题,我应该将文件的长度设置为零还是应该让文件保持原样?如果它是一个目录,我应该删除所有内容吗?

0 投票
1 回答
984 浏览

ruby - Ruby code on NFS mount, using another file on same mount causes problems

I'm working on an embedded system whoose details are explained at the end of this post. Tools are ruby on linux.

I put my ruby code on a remote NAS device on network and mount it to the embedded system I'm working on using NFS v3. My project scenario is like this: there is an all-in-one auto starter which 1.mounts the nfs share, 2. starts the webrick ruby code on mounted dir, 3. starts some other biz-logic related ruby code again on mounted dir, 4. starts a ruby code on local file system which does some basic logging and stuff... I put each step in a loop that will retry when a start operation fails (start operations are made by system 'ruby XXXX' or popen3 calls). Here's what happens when I run this starter: step1 goes ok, step 2 fails, step 3 fails, step 4 goes ok, then step2 and 3 are retried and both starts ok too allways at second trial(I want to add that started codes are independent so; it doesnt matter which one starts first and changing the start order didnt make any difference).

I have inspected this problem and found out it also happens when I start things manually from shell and filtered it down to this: My webrick code loads .rb files that are at the same directory as itself and has some FileHandlers using the subdirs in NFS mount and my biz-logic also loads .rb files from nfs mount. And this, I believe, is the source of my problem (I have tried to load those files using both absolute paths like '/mnt/myMount/myLib.rb' and File.Join which both didnt make any difference).

Also, the webrick filehandlers too act pretty strange in this scenario, they always fail at first request of a file and then succeeds at the second request, no matter the file size.

To sum up, as the title says, when a Ruby code on NFS mount uses another file on same mount, ruby gives an EIO (Input Output Error). I was able to reproduce this problem using simple .rb files (that just print itselves filename) loading each other as explained in the above scenario on my environment (though I havent tried this on a regular PC). How can I solve this, is it about the paths given to load/require methods or what?

My working envrionment: The device I'm working with is an intelligent RFID reader, with an embedded linux arm based computer on-board. The only api/language manufacturer allows and provides (w/o getting out of license terms) is ruby, and they give no-support for installing extra-stuff and they have customized the kernel in device to make installing/compiling anything as hard as possible. I can use extra ruby stuff if they're just .rb lib files that is I can easily just include them in my code, but anything that requires compiling is a no-no. Also, this system does not have gem.

0 投票
2 回答
1779 浏览

encoding - NFS 文件名 ASCII 标准之外的字符?

好吧,我已经实现了自己的 NFS 服务器,一切正常,但是我如何编码不属于 ASCII 标准的字符?XDR RFC 说字符串被编码为 ascii,然后会删除所有非 ascii 字符?但是如果我启动一个我还没有编写的 nfs 服务器,它似乎支持那些字符......

我尝试创建一个名为“hej åäö”的文件夹,它在 nfs 客户端上正确显示,如果我查看使用 WireShark 发送的数据,我得到字符串“hej \345\344\366”或十六进制“68656a20e5e4f6”什么编码这是?

还尝试 ed 编码“hej 1 + 1 = 2”..

尝试 ed UTF-7 在 åäö 上效果很好,但在 + 上效果不佳,所以它不是 UTF-7

0 投票
2 回答
941 浏览

c# - 通过 NFS 上的 C# 读取 UNIX 文件属性

我有两台服务器。

  1. solaris 10 充当 NFS 服务器
  2. 安装了 UNIX/NFS 扩展的 win 2003 ernterprise 服务器充当 NFS 客户端

win 2003 服务器已经挂载了一份solaris 系统。如何(通过 C#)检查-rw-r--r--位于 NFS 共享上的远程文件的原始 UNIX 文件属性(例如:)?

0 投票
7 回答
44465 浏览

linux - 有没有检测过时 NFS 挂载的好方法

我有一个程序,只有在几个测试成功完成时才想启动。

我需要的一项测试是我的所有 NFS 挂载都正常运行。

我能比蛮力方法做得更好吗:


timeout是一个实用程序,它将在后台运行命令,并在给定时间后将其杀死,如果SIGCHLD在时间限制之前没有被捕获,则以明显的方式返回成功/失败。


英文:解析 的输出mount,检查(以超时为界)每个 NFS 挂载点。可选(不在上面的代码中)在第一个陈旧的挂载上中断。