Noip“找不到配置文件”,但该文件在那里

Noip“找不到配置文件”,但该文件在那里

我安装了 Noip 并运行了创建配置文件的命令

/usr/local/bin/noip2 -C

然后我运行了运行命令

/usr/local/bin/noip2

它回来了

Can't locate configuration file /usr/local/etc/no-ip2.conf. (Try -c). Ending!

我检查了文件的位置,它确实在那里。知道为什么它找不到该文件吗?

跟踪输出:

execve("/usr/local/bin/noip2", ["/usr/local/bin/noip2"], [/* 15 vars */]) = 0
brk(0)                                  = 0x1375000
uname({sys="Linux", node="raspberrypi", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f33000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
mmap2(NULL, 44, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0xb6f32000
close(3)                                = 0
open("/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\270\4\0\0004\0\0\0"..., 512) = 512
lseek(3, 7276, SEEK_SET)                = 7276
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 7001, SEEK_SET)                = 7001
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=10170, ...}) = 0
mmap2(NULL, 39740, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f07000
mprotect(0xb6f09000, 28672, PROT_NONE)  = 0
mmap2(0xb6f10000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb6f10000
close(3)                                = 0
munmap(0xb6f32000, 44)                  = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44950, ...}) = 0
mmap2(NULL, 44950, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6efc000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\214y\1\0004\0\0\0"..., 512) = 512
lseek(3, 1198880, SEEK_SET)             = 1198880
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1360) = 1360
lseek(3, 1198444, SEEK_SET)             = 1198444
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1200240, ...}) = 0
mmap2(NULL, 1242408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6dcc000
mprotect(0xb6eef000, 28672, PROT_NONE)  = 0
mmap2(0xb6ef6000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x122) = 0xb6ef6000
mmap2(0xb6ef9000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6ef9000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f32000
set_tls(0xb6f324c0, 0xb6f32b98, 0xb6f37048, 0xb6f324c0, 0xb6f37048) = 0
mprotect(0xb6ef6000, 8192, PROT_READ)   = 0
mprotect(0xb6f36000, 4096, PROT_READ)   = 0
munmap(0xb6efc000, 44950)               = 0
rt_sigaction(SIGHUP, {SIG_IGN, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGPIPE, {SIG_IGN, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGUSR1, {SIG_IGN, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {SIG_IGN, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGALRM, {0xa568, [], 0x4000000 /* SA_??? */}, NULL, 8) = 0
getcwd("/home/pi", 4096)                = 9
lstat64("/home/pi/noip2", 0xbef6f670)   = -1 ENOENT (No such file or directory)
open("/usr/local/etc/no-ip2.conf", O_RDWR) = -1 EACCES (Permission denied)
open("/usr/local/etc/no-ip2.conf", O_RDONLY) = -1 EACCES (Permission denied)
write(2, "Can't locate configuration file "..., 79Can't locate configuration file /usr/local/etc/no-ip2.conf. (Try -c). Ending!

) = 79
exit_group(-1)                          = ?

谢谢

答案1

open("/usr/local/etc/no-ip2.conf", O_RDWR) = -1 EACCES (Permission denied)
open("/usr/local/etc/no-ip2.conf", O_RDONLY) = -1 EACCES (Permission denied)

noip2尝试打开其配置文件进行读取和写入,当失败时,它会再次尝试读取,这也会失败。失败是因为没有权限;错误消息很笼统,毫无帮助。

检查配置文件和指向它的目录的权限(当然//usr问题,否则你的系统会以更明显的方式被破坏)。

ls -ld /usr/local /usr/local/etc /usr/local/etc/no-ip2.conf

这些目录必须至少具有x运行该命令的用户的权限位——可能是所有用户。文件本身必须至少具有r权限位。目录应该具有r权限位(严格来说,这不是必需的,但这是正常的事情;请参阅访问子目录时父目录的权限重要吗?了解详情)。

您可能需要chmod a+rX /usr/local/etc /usr/local/etc/no-ip2.conf,除非配置文件应该是机密的(例如因为它包含密码)。

如果其中一个条目在//权限位+之后,则存在安全框架(例如 SELinux),它可能会施加额外的限制。rwx

答案2

我遇到了这个问题。我认为这是一个权限问题。它对我来说以 root 身份运行它是有效的:

$ sudo noip2

您可能必须先终止正在运行的实例。

$ ps -A |grep noip
 1577 ?        00:00:00 noip2
$ sudo kill 1577

答案3

这是一个权限问题。我修复了:

chown noip.wheel /usr/local/etc/no-ip2.conf

答案4

我的是RO文件系统,strace显示 , O_RDWR) = -1 EROFS (Read-only file system)

复制到 /dev/shm 有帮助:D

相关内容