SAMBA doit être redémarré pour qu'il fonctionne

Bonjour à tous !

Un petit problème sous testing : pour que Samba fonctionne je dois lancer la commande :

c’est pas pratique (surtout pour mon épouse, lui expliquer la procédure ?, bof…)

je lis dans le syslog :

serait-ce là le problème ?
c’est bizarre : ce fichier existe bien et il est bien modifié pendant le boot …

vous avez une idée ?
merci d’avance !

invar

Hello,

Il s’agit de quel version de samba ? Car il risque d’y avoir une grosse différence suivant les versions :slightly_smiling:

Le mieux serait de le mettre en mode debug pour avoir plus de log car là… Ça donne l’impression que ton fichier pid à été del, il faudrait vérifier sa présence avant un restart et faire un lsof |grep /var/run/samba/smbd.pid pour voir si samba le prend toujours en compte.

C’est quoi qui ne fonctionne plus exactement ? Il y a un contexte ?

merci pour ton intervention TrashHard

version de Samba : 4.1.17

ce qui ne va pas : on essaye de se connecter à partir d’un ipad à mon PC
ça fonctionnne pas …
je lance la commande systemctl restart smbd.service
et là ok on peut parcourir les fichiers à partir de l’ipad

le fichier smbd.pid est bien présent et est renouvelé à chaque boot

mettre en mode debug … euhhh là je vois pas comment faire

sinon j’imaginais lancer un script en autostart …

merci encore
invar

Tu peux tout simplement augmenter ton log leve dans ton smd.conf :
wiki.samba.org/index.php/Samba_ … g_the_logs

Effectivement mettre un script de restart samba peut-être un moyen de contourner le problème en attendant mais ça résoudra pas ton problème hélas :slightly_smiling:

si tu creés un fichier vide “/var/run/samba/smbd.pid” avec “touch” qu’est ce que ca donne?

En faite le fichier pid contient uniquement le numéro du process qui est en cours, il y en a pour tout les processus. Il est créé quand un processus ce lance et est delete quand un process se termine. Si il n’est plus présent c’est que le process est considéré comme terminé. Il faudrait voir quand tu as ton incident si le process est toujours en cours avec un ps aux |grep smd

Si il existe toujours tu peux lancer un strace -p <tonPid> (la commande stance s’installe avec le paquet du même nom), ça te permettra de voir si le process envois toujours des infos ou pas si il envoi rien ou qu’il tourne en boucle c’est probablement qu’il est planté. Dans tout les cas tu auras ta réponse en augmentant ton niveau de log.

merci pour vos interventions

le fichier /var/log/samba/log.smbd :

[quote][2015/06/18 18:02:19, 0] …/source3/smbd/server.c:1189(main)
smbd version 4.1.17-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2015/06/18 18:02:19, 2] …/source3/lib/tallocmsg.c:124(register_msg_pool_usage)
Registered MSG_REQ_POOL_USAGE
[2015/06/18 18:02:19, 2] …/source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED[2015/06/18 18:02:19, 0] …/source3/smbd/server.c:1189(main)
smbd version 4.1.17-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2015/06/18 18:02:19, 2] …/source3/lib/tallocmsg.c:124(register_msg_pool_usage)
Registered MSG_REQ_POOL_USAGE
[2015/06/18 18:02:19, 2] …/source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED[/quote]

en utilisant strace j’obtiens (glurp : c’est du chinois pour moi … :unamused: ) :

[quote]root@debian:/home/p# strace -p 1401
Process 1401 attached
restart_syscall(<… resuming interrupted call …>) = 0
pipe([34, 35]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3cf837ba10) = 3110
close(35) = 0
poll([{fd=34, events=POLLIN|POLLHUP}, {fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 4, 2147483647) = 1 ([{fd=34, revents=POLLIN}])
recvfrom(34, 0x7f3cf8583020, 4, 0, 0, 0) = -1 ENOTSOCK (Socket operation on non-socket)
read(34, “<\0\0\0”, 4) = 4
close(34) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
— SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3110, si_uid=0, si_status=0, si_utime=0, si_stime=0} —
write(8, “\0”, 1) = 1
rt_sigreturn() = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 3110
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2944, …}) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=91484, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 91484
write(9, “[2015/06/18 18:07:19.875880, 2]”…, 80) = 80
munmap(0x7f3cf83b7000, 4096) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=91564, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 91564
write(9, " Could not find child 3110 – i"…, 40) = 40
munmap(0x7f3cf83b7000, 4096) = 0
wait4(-1, 0x7ffef5ff813c, WNOHANG, NULL) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59998) = 1 ([{fd=7, revents=POLLIN}])
read(7, “\0”, 16) = 1
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59998) = 0 (Timeout)
pipe([34, 35]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3cf837ba10) = 3169
close(35) = 0
poll([{fd=34, events=POLLIN|POLLHUP}, {fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 4, 2147483647) = 1 ([{fd=34, revents=POLLIN}])
recvfrom(34, 0x7f3cf8583020, 4, 0, 0, 0) = -1 ENOTSOCK (Socket operation on non-socket)
read(34, “<\0\0\0”, 4) = 4
close(34) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
— SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3169, si_uid=0, si_status=0, si_utime=0, si_stime=0} —
write(8, “\0”, 1) = 1
rt_sigreturn() = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 3169
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2944, …}) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92217, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 91604
write(9, “[2015/06/18 18:08:19.938363, 2]”…, 80) = 80
munmap(0x7f3cf83b7000, 4096) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92297, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 92297
write(9, " Could not find child 3169 – i"…, 40) = 40
munmap(0x7f3cf83b7000, 4096) = 0
wait4(-1, 0x7ffef5ff813c, WNOHANG, NULL) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59999) = 1 ([{fd=7, revents=POLLIN}])
read(7, “\0”, 16) = 1
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59999) = 0 (Timeout)
pipe([34, 35]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3cf837ba10) = 3177
close(35) = 0
poll([{fd=34, events=POLLIN|POLLHUP}, {fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 4, 2147483647) = 1 ([{fd=34, revents=POLLIN}])
recvfrom(34, 0x7f3cf8583020, 4, 0, 0, 0) = -1 ENOTSOCK (Socket operation on non-socket)
read(34, “<\0\0\0”, 4) = 4
close(34) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
— SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3177, si_uid=0, si_status=0, si_utime=0, si_stime=0} —
write(8, “\0”, 1) = 1
rt_sigreturn() = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 3177
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2944, …}) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92537, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 92337
write(9, “[2015/06/18 18:09:20.001161, 2]”…, 80) = 80
munmap(0x7f3cf83b7000, 4096) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92617, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 92617
write(9, " Could not find child 3177 – i"…, 40) = 40
munmap(0x7f3cf83b7000, 4096) = 0
wait4(-1, 0x7ffef5ff813c, WNOHANG, NULL) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59999) = 1 ([{fd=7, revents=POLLIN}])
read(7, “\0”, 16) = 1
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59999) = 0 (Timeout)
pipe([34, 35]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3cf837ba10) = 3184
close(35) = 0
poll([{fd=34, events=POLLIN|POLLHUP}, {fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 4, 2147483647) = 1 ([{fd=34, revents=POLLIN}])
recvfrom(34, 0x7f3cf8583020, 4, 0, 0, 0) = -1 ENOTSOCK (Socket operation on non-socket)
read(34, “<\0\0\0”, 4) = 4
close(34) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
— SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3184, si_uid=0, si_status=0, si_utime=0, si_stime=0} —
write(8, “\0”, 1) = 1
rt_sigreturn() = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 3184
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2944, …}) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92657, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 92657
write(9, “[2015/06/18 18:10:20.063353, 2]”…, 80) = 80
munmap(0x7f3cf83b7000, 4096) = 0
geteuid() = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=92737, …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3cf83b7000
lseek(9, 0, SEEK_CUR) = 92737
write(9, " Could not find child 3184 – i"…, 40) = 40
munmap(0x7f3cf83b7000, 4096) = 0
wait4(-1, 0x7ffef5ff813c, WNOHANG, NULL) = 0
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59998) = 1 ([{fd=7, revents=POLLIN}])
read(7, “\0”, 16) = 1
poll([{fd=33, events=POLLIN|POLLHUP}, {fd=32, events=POLLIN|POLLHUP}, {fd=7, events=POLLIN|POLLHUP}], 3, 59998^CProcess 1401 detached
<detached …>
[/quote]

si je vide le fichier smbd.pid ? (root a bien les droits de lecture et d’écriture)
rien ne se passe (pas de connexion)
même après la commande : systemctl restart smbd.service
(aucun numéro ne s’inscrit dans le fichier)