因此,起初 Samba 即使在更新后也能正常工作,由于服务器端硬盘驱动器上缺少 GB,我更改了驱动器的标签。将我需要的所有内容更改为相关位置和文件。一切正常,可以从 Windows 笔记本电脑和 Linux 笔记本电脑访问。
几天后,我发现我的 Linux 笔记本电脑上没有安装驱动器。当时还不以为然。我的妻子抱怨服务器无法访问,现在经过调查,我已经没有其他选择了:
tail -f /var/log/kernel.log
一开始就给出了以下内容:
Oct 15 21:43:07 Laptop kernel: [ 3910.412985] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Oct 15 21:43:07 Laptop kernel: [ 3910.418005] CIFS VFS: Error connecting to socket. Aborting operation.
Oct 15 21:43:07 Laptop kernel: [ 3910.418016] CIFS VFS: cifs_mount failed w/return code = -111
所以我修改了 /etc/fstab 条目并添加:
/media/movies cifs auto,*`vers=1.0`*,credentials=/etc/samba/user,noexec 0 0
只剩下:
Oct 15 21:49:06 Laptop kernel: [ 4269.887208] CIFS VFS: Error connecting to socket. Aborting operation.
Oct 15 21:49:06 Laptop kernel: [ 4269.887218] CIFS VFS: cifs_mount failed w/return code = -111
所以我得到了正确的版本,但现在它给我留下了返回代码 -111,谷歌说基本上任何事情都可能是错误的。
在服务器端:服务 smb 状态显示
>● smb.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
service smbd status
>● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
Active: active (exited) since Mon 2018-10-15 21:11:36 CEST; 43min ago
Docs: man:systemd-sysv-generator(8)
Process: 1136 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)
Oct 15 21:11:38 rabbithole smbd[1159]: #10 /usr/sbin/smbd(main+0x1899) [0x55c64af04099]
Oct 15 21:11:38 rabbithole smbd[1159]: #11 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f410b059b97]
Oct 15 21:11:38 rabbithole smbd[1159]: #12 /usr/sbin/smbd(_start+0x29) [0x55c64af04199]
Oct 15 21:11:38 rabbithole smbd[1159]: [2018/10/15 21:11:38.090690, 0] ../source3/lib/util.c:801(smb_panic_s3)
Oct 15 21:11:38 rabbithole smbd[1159]: smb_panic(): calling panic action [/usr/share/samba/panic-action 1159]
Oct 15 21:11:38 rabbithole smbd[1159]: [2018/10/15 21:11:38.098636, 0] ../source3/lib/util.c:809(smb_panic_s3)
Oct 15 21:11:38 rabbithole smbd[1159]: smb_panic(): action returned status 0
Oct 15 21:11:38 rabbithole smbd[1159]: [2018/10/15 21:11:38.098738, 0] ../source3/lib/dumpcore.c:303(dump_core)
Oct 15 21:11:38 rabbithole smbd[1159]: dumping core in /var/log/samba/cores/smbd
Oct 15 21:11:38 rabbithole smbd[1159]:
可能每个人都注意到了这一点,但我的知识并不那么丰富,所以我希望这里的人们知道其他一些解决方案,或者给我指点,因为我认为这超出了新手水平:)
也许最好的建议是复制 /etc/samba/smb.conf 并重新安装 samba。或者运行替代方法(有吗?)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 16-10-2018 添加:
看起来服务器端越来越不可用:当使用
sudo smbclient -L //server_ip -U user
我被提示输入用户密码,在我确定我添加了正确的密码后:
WARNING: The "syslog" option is deprecated
Enter diet's password:
Connection to 192.168.178.21 failed (Error NT_STATUS_CONNECTION_REFUSED)
添加了更多:
当在客户端执行 nmblookup 命令时,服务器不会显示,尝试了该命令的各种变体,但服务器的 IP 地址并未显示。smbtree 也没有提供服务器。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 添加于 2018-10-18
我对恐慌反应进行了深入研究,并查看了日志文件 /var/log/samba/log.nmdb,在其中发现了以下内容
diet@rabbithole:~$ sudo cat /var/log/samba/log.nmbd
[2018/10/15 21:11:36.244286, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2018/10/15 21:11:36.244592, 0] ../lib/util/fault.c:78(fault_report)
===============================================================
[2018/10/15 21:11:36.244651, 0] ../lib/util/fault.c:79(fault_report)
INTERNAL ERROR: Signal 11 in pid 1135 (4.3.11-Ubuntu)
Please read the Trouble-Shooting section of the Samba HOWTO
[2018/10/15 21:11:36.244708, 0] ../lib/util/fault.c:81(fault_report)
===============================================================
[2018/10/15 21:11:36.244750, 0] ../source3/lib/util.c:789(smb_panic_s3)
PANIC (pid 1135): internal error
[2018/10/15 21:11:36.245703, 0] ../source3/lib/util.c:900(log_stack_trace)
BACKTRACE: 11 stack frames:
#0 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x1a) [0x7f58521627aa]
#1 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x20) [0x7f5852162880]
#2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f585445ff1f]
#3 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(+0x1b136) [0x7f5854460136]
#4 /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f58548c4890]
#5 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(talloc_get_size+0x5) [0x7f58517005a5]
#6 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(event_add_to_poll_args+0x76) [0x7f5853846556]
#7 /usr/sbin/nmbd(listen_for_packets+0xff) [0x5590a81f47af]
#8 /usr/sbin/nmbd(main+0xcf6) [0x5590a81e3bb6]
#9 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f5850cfbb97]
#10 /usr/sbin/nmbd(_start+0x29) [0x5590a81e3f79]
[2018/10/15 21:11:36.245966, 0] ../source3/lib/util.c:801(smb_panic_s3)
smb_panic(): calling panic action [/usr/share/samba/panic-action 1135]
[2018/10/15 21:11:36.259765, 0] ../source3/lib/util.c:809(smb_panic_s3)
smb_panic(): action returned status 0
[2018/10/15 21:11:36.260473, 0] ../source3/lib/dumpcore.c:303(dump_core)
dumping core in /var/log/samba/cores/nmbd
[2018/10/16 22:25:50.464532, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2018/10/16 22:25:50.501751, 0] ../lib/util/fault.c:78(fault_report)
===============================================================
[2018/10/16 22:25:50.501817, 0] ../lib/util/fault.c:79(fault_report)
INTERNAL ERROR: Signal 11 in pid 1069 (4.3.11-Ubuntu)
Please read the Trouble-Shooting section of the Samba HOWTO
[2018/10/16 22:25:50.501886, 0] ../lib/util/fault.c:81(fault_report)
===============================================================
[2018/10/16 22:25:50.501927, 0] ../source3/lib/util.c:789(smb_panic_s3)
PANIC (pid 1069): internal error
[2018/10/16 22:25:50.502887, 0] ../source3/lib/util.c:900(log_stack_trace)
BACKTRACE: 11 stack frames:
#0 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x1a) [0x7f58a6df07aa]
#1 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x20) [0x7f58a6df0880]
#2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f58a90edf1f]
#3 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(+0x1b136) [0x7f58a90ee136]
#4 /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f58a9552890]
#5 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(talloc_get_size+0x5) [0x7f58a638e5a5]
#6 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(event_add_to_poll_args+0x76) [0x7f58a84d4556]
#7 /usr/sbin/nmbd(listen_for_packets+0xff) [0x5626ea7dc7af]
#8 /usr/sbin/nmbd(main+0xcf6) [0x5626ea7cbbb6]
#9 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f58a5989b97]
#10 /usr/sbin/nmbd(_start+0x29) [0x5626ea7cbf79]
[2018/10/16 22:25:50.503153, 0] ../source3/lib/util.c:801(smb_panic_s3)
smb_panic(): calling panic action [/usr/share/samba/panic-action 1069]
[2018/10/16 22:25:50.512666, 0] ../source3/lib/util.c:809(smb_panic_s3)
smb_panic(): action returned status 0
[2018/10/16 22:25:50.512764, 0] ../source3/lib/dumpcore.c:303(dump_core)
dumping core in /var/log/samba/cores/nmbd
[2018/10/18 19:44:06.860935, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
[2018/10/18 19:44:06.894869, 0] ../lib/util/fault.c:78(fault_report)
===============================================================
[2018/10/18 19:44:06.894939, 0] ../lib/util/fault.c:79(fault_report)
INTERNAL ERROR: Signal 11 in pid 1046 (4.3.11-Ubuntu)
Please read the Trouble-Shooting section of the Samba HOWTO
[2018/10/18 19:44:06.894998, 0] ../lib/util/fault.c:81(fault_report)
===============================================================
[2018/10/18 19:44:06.895041, 0] ../source3/lib/util.c:789(smb_panic_s3)
PANIC (pid 1046): internal error
[2018/10/18 19:44:06.896034, 0] ../source3/lib/util.c:900(log_stack_trace)
BACKTRACE: 11 stack frames:
#0 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x1a) [0x7f1e44bbf7aa]
#1 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x20) [0x7f1e44bbf880]
#2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f1e46ebcf1f]
#3 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(+0x1b136) [0x7f1e46ebd136]
#4 /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f1e47321890]
#5 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(talloc_get_size+0x5) [0x7f1e4415d5a5]
#6 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(event_add_to_poll_args+0x76) [0x7f1e462a3556]
#7 /usr/sbin/nmbd(listen_for_packets+0xff) [0x55ff3c5c47af]
#8 /usr/sbin/nmbd(main+0xcf6) [0x55ff3c5b3bb6]
#9 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f1e43758b97]
#10 /usr/sbin/nmbd(_start+0x29) [0x55ff3c5b3f79]
[2018/10/18 19:44:06.896297, 0] ../source3/lib/util.c:801(smb_panic_s3)
smb_panic(): calling panic action [/usr/share/samba/panic-action 1046]
[2018/10/18 19:44:06.906076, 0] ../source3/lib/util.c:809(smb_panic_s3)
smb_panic(): action returned status 0
[2018/10/18 19:44:06.906178, 0] ../source3/lib/dumpcore.c:303(dump_core)
dumping core in /var/log/samba/cores/nmbdADDED 18-10-2018
谷歌引导我错误日志我发现了“完全”相同的故障代码。
现在的问题是,我该如何解决这个问题?我如何降级到 libtevent 0.9.28 来查看是否能解决这个问题?
我发现这一页所以我知道它在旧的存储库中,这是我添加的,但是当我使用
diet@rabbithole:~$ sudo apt-get install libtevent-dev=0.9.28-0ubuntu0.14.04.1
我明白
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libtevent-dev : Depends: libtevent0 (= 0.9.28-0ubuntu0.14.04.1) but 0.9.34-1 is to be installed
E: Unable to correct problems, you have held broken packages.
尽管我认为我已经发现了一些问题,但我还是想知道为什么在更新到 18.04 后会出现这个问题。buzilla 报告是前一段时间提出的,其中提到解决方案是我暂时无法推出的,因为我缺乏对包及其依赖项进行回滚的技能。
答案1
好吧,我通过将 libtevent 回滚到 0.9.28 解决了这个问题
使用的命令:
首先我将以下存储库添加到 /etc/apt.sources.list:
deb http://security.ubuntu.com/ubuntu trusty-security main
然后
sudo apt-get update
现在你可以选择 2 个选项,其中选项 2 的输出较少
选项1
sudo apt-cache showpkg libtevent0
选项 2
sudo apt-cache policy libtevent0
您将会看到旧版本可用
下一个
sudo apt-get install libtevent0=0.9.28-0ubuntu0.14.04.1
按 y 并输入
而回滚也是事实。
sudo service smbd restart && sudo service smbd status
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
Active: active (running) since Thu 2018-10-18 21:31:59 CEST; 9min ago
Docs: man:systemd-sysv-generator(8)
Process: 3798 ExecStop=/etc/init.d/smbd stop (code=exited, status=0/SUCCESS)
Process: 3812 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/smbd.service
├─3826 /usr/sbin/smbd -D
├─3827 /usr/sbin/smbd -D
├─3829 /usr/sbin/smbd -D
├─3847 /usr/sbin/smbd -D
└─3848 /usr/sbin/smbd -D
Oct 18 21:31:58 rabbithole systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Oct 18 21:31:59 rabbithole smbd[3812]: * Starting SMB/CIFS daemon smbd
Oct 18 21:31:59 rabbithole smbd[3812]: ...done.
Oct 18 21:31:59 rabbithole systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).
Oct 18 21:31:59 rabbithole smbd[3826]: [2018/10/18 21:31:59.315254, 0] ../lib/util/become_daemon.c:124(daemon_ready)
Oct 18 21:31:59 rabbithole smbd[3826]: STATUS=daemon 'smbd' finished starting up and ready to serve connections
Oct 18 21:32:26 rabbithole smbd[3847]: pam_unix(samba:session): session opened for user diet by (uid=0)
Oct 18 21:32:26 rabbithole smbd[3848]: pam_unix(samba:session): session opened for user diet by (uid=0)
为了安全起见,我标记了 libtevent 包不再更新。不确定将来会有什么后果。
sudo apt-mark hold libtevent0
希望这能够帮助其他可能遇到与我相同问题的人。