หาคำสั่งเอาท์พุทอะไร


1

เมื่อเร็ว ๆ นี้พบว่าพฤติกรรมคำสั่งแปลก ๆ

[root@luna ~]# find / -name \*.sh -print
[root@luna ~]# find / -name \*.sh -print
/home/data/tools/rd/RDService/scripts/createZipArchive.sh
/home/data/tools/rd/RDService/scripts/createImgArchive.sh
find: `/home/data/lost+found': Permission denied
find: `/home/music/lost+found': Permission denied
(snip)

ฉันค้นหาพบ แต่ไม่ได้อะไรเลยและออกจากภายใน 1 วินาที ดังนั้นฉันทำอีกครั้ง ฉันได้ผลลัพธ์ที่ถูกต้องในครั้งนี้ (NFS ได้รับอนุญาตถูกปฏิเสธ)

ฉันใช้ arch linux 64bit เวอร์ชันของ find เป็นดังนี้:

[root@luna ~]# type -a find
find is /usr/bin/find
[root@luna ~]# find --version | head -1
find (GNU findutils) 4.4.2
[root@luna ~]# 

ความช่วยเหลือใด ๆ

แก้ไข:

[root@luna ~]# find / -name \*.sh -print
[root@luna ~]# echo $?
0
[root@luna ~]# find / -name \*.sh -print
/home/data/tools/rd/RDService/scripts/createZipArchive.sh
/home/data/tools/rd/RDService/scripts/createImgArchive.sh
find: `/home/data/lost+found': Permission denied
^C
[root@luna ~]# 

แก้ไข:

ดูเหมือนว่าจะทำซ้ำได้หลังจากรีบูต

ฉันมีสองบรรทัดนี้ใน / etc / fstab:

nicobo:/export/music    /home/music     nfs             vers=4.2,rw,soft,bg,intr,noauto,x-systemd.automount,x-systemd.device-timeout=10 0 0
nicobo:/export/data     /home/data      nfs             vers=4.2,rw,soft,bg,intr,noauto,x-systemd.automount,x-systemd.device-timeout=10 0 0

หลังจากที่ฉันคอมเม้นท์บรรทัดเหล่านี้แล้วรีบูตก็ไม่สามารถทำซ้ำได้ ฉันไม่ใส่ข้อคิดเห็น, รีบูตเครื่องและฉันได้รับดังต่อไปนี้:

[root@luna ~]# ls /home/data > /dev/null
[root@luna ~]# ls /home/music > /dev/null
[root@luna ~]# find / -name \*.sh -print
/home/data/tools/rd/RDService/scripts/createZipArchive.sh
/home/data/tools/rd/RDService/scripts/createImgArchive.sh
find: `/home/data/lost+found': Permission denied
^C
[root@luna ~]# 

และฉันสามารถทำซ้ำได้:

[root@luna ~]# umount /home/data
[root@luna ~]# find / -name \*.sh -print
[root@luna ~]# find / -name \*.sh -print
/home/data/tools/rd/RDService/scripts/createZipArchive.sh
/home/data/tools/rd/RDService/scripts/createImgArchive.sh
find: `/home/data/lost+found': Permission denied
^C
[root@luna ~]# umount /home/data
[root@luna ~]# find / -name \*.sh -print
[root@luna ~]# find / -name \*.sh -print
/home/data/tools/rd/RDService/scripts/createZipArchive.sh
/home/data/tools/rd/RDService/scripts/createImgArchive.sh
find: `/home/data/lost+found': Permission denied
^C
[root@luna ~]# 

ดูเหมือนว่าจะเป็นปัญหาที่เกี่ยวข้องกับ autofs


1
สวัสดียินดีต้อนรับผู้ใช้ระดับสูง ฉันมีเวอร์ชั่นเดียวกันfindกับการกระจายอื่น ๆ ฉันทำงานได้ตามที่คาดไว้ โปรดเรียกใช้อีกครั้งfind / -name \*.sh -printและเมื่อออกจากเขียนecho $?ให้เข้าใจว่ามันล้มเหลว
Hastur

ฉันก็ใช้findเวอร์ชั่นเดียวกันบน ArchLinux amd64 มันทำงานได้อย่างสมบูรณ์แบบในระบบของฉัน
MariusMatutiae

ดังนั้นดูเหมือนว่าครั้งแรกที่คุณเรียกใช้findระบบไฟล์ไม่ได้ติดตั้ง แต่โดยครั้งที่สอง autofs ได้ทำสิ่งนั้นหรือไม่ ถ้าเป็นเช่นนั้นฉันคิดว่ามันทำงานได้ตามที่คาดไว้
ams

เมื่อฉันไม่ได้ติดตั้งระบบไฟล์และฉันเข้าถึงมันควรจะติดตั้งและเข้าถึงได้ฉันคิดว่า แก้ไขเวอร์ชัน git ของ findutils แล้ว
58

คำตอบ:


โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.