Samba failed

Bonsoir,

J’ai migré de wheezy à jessie puis de jessie à stretch sur mon serveur.
J’ai un souci avec samba qui me refuse le partage :

[quote]# systemctl status smbd
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-09-16 21:11:30 CEST; 1h 15min ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Process: 706 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=1/FAILURE)
Main PID: 706 (code=exited, status=1/FAILURE)
Status: "daemon failed to start: Samba failed to init printing subsystem"
Error: 13 (Permission non accordée)

sept. 16 21:11:27 serveur-debian systemd[1]: Starting Samba SMB Daemon…[/quote]

Je ne sais pas trop quoi faire :sleepy:

testparm /etc/samba/smb.conf

[quote]$ testparm /etc/samba/smb.conf
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The “syslog” option is deprecated
Processing section "[homes]"
Processing section "[print$]"
WARNING: No path in service print$ - making it unavailable!
NOTE: Service print$ is flagged unavailable.
Processing section "[Donnees]"
Processing section "[Sauvegardes]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

Global parameters

[global]
server string = %h server
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
usershare allow guests = Yes
printcap name = cups
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
passwd program = /usr/bin/passwd %u
security = USER
unix password sync = Yes
dns proxy = No
idmap config * : backend = tdb
hide files = /lost+found/.Trash*/*.bak/

[homes]
comment = Home Directories
browseable = No
create mask = 0770
directory mask = 0770
read only = No
valid users = %S

[print$]
available = No

[Donnees]
path = /media/Donnees_famille
create mask = 0770
directory mask = 0770
valid users = @donnees
write list = ordimac liliminu toto adminubuntu matetefoot adulte xbox

[Sauvegardes]
path = /media/Sauvegardes
create mask = 0770
directory mask = 0770
valid users = @sauvegarde
write list = toto69[/quote]

la section Global ?

tu peux donner le résultat du syslog, tu fais un tail -f /var/log/syslog

et dans un autre terminal tu restart le service smbd

[quote][global]

Browsing/Identification

Change this to the workgroup/NT-domain name your Samba server will part of

workgroup = WORKGROUP

server string is the equivalent of the NT Description field

server string = %h server

Windows Internet Name Serving Support Section:

WINS Support - Tells the NMBD component of Samba to enable its WINS Server

wins support = no

WINS Server - Tells the NMBD components of Samba to be a WINS Client

Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

; wins server = w.x.y.z

This will prevent nmbd to search for NetBIOS names through DNS.

dns proxy = no

What naming service and in what order should we use to resolve host names

to IP addresses

; name resolve order = lmhosts host wins bcast

Cas particulier pour hide files, les noms de fichiers à cacher sont entre /

#, exemple si on veut cacher les répertoires lost+found, les corbeilles et les
#fichiers .bak
hide files = /lost+found/.Trash
/*.bak/[/quote]
Pourquoi tout est en gros caractère gras ???

[quote]Sep 17 08:59:10 serveur-debian systemd[1]: Starting Samba SMB Daemon…
Sep 17 08:59:10 serveur-debian systemd[1]: smbd.service: Supervising process 2476 which is not our child. We’ll most likely not notice when it exits.
Sep 17 08:59:11 serveur-debian systemd[1]: Started Samba SMB Daemon.
Sep 17 08:59:11 serveur-debian systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
Sep 17 08:59:11 serveur-debian systemd[1]: smbd.service: Unit entered failed state.
Sep 17 08:59:11 serveur-debian systemd[1]: smbd.service: Failed with result ‘exit-code’.
Sep 17 08:59:11 serveur-debian dhcpd[1358]: DHCPREQUEST for 172.16.10.10 from b0:a2:e7:54:98:67 (android-7bd80cb28de63201) via br0
Sep 17 08:59:11 serveur-debian dhcpd[1358]: DHCPACK on 172.16.10.10 to b0:a2:e7:54:98:67 (android-7bd80cb28de63201) via br0[/quote]

tu as cups d’installé ou task-print-server ?
c’est en gras car tu as des “#”

Bonne question ! Il me semble avoir vu passé un message en rouge avec cups dedans lost du dist-upgrade. Je n’y ai pas prété d’attention car je n’ai pas d’imprimante en reseau.

[quote]# apt-cache policy task-print-server
task-print-server:
Installé : 3.39
Candidat : 3.39
Table de version :
*** 3.39 500
500 http://ftp.fr.debian.org/debian stable/main i386 Packages
100 /var/lib/dpkg/status[/quote]

[quote]# apt-cache policy cups
cups:
Installé : 2.2.1-8
Candidat : 2.2.1-8
Table de version :
*** 2.2.1-8 500
500 http://ftp.fr.debian.org/debian stable/main i386 Packages
100 /var/lib/dpkg/status[/quote]
Les deux mon capitaine !

et si tu commente ta section “printer”

le services cups tournent ?

tu vérifies le status de cups comment ? ‘# status cups’ ne fonctionne pas

[quote]# systemctl status cups
● cups.service - CUPS Scheduler
Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2017-09-17 06:25:04 CEST; 3h 11min ago
Docs: man:cupsd(8)
Main PID: 2061 (cupsd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cups.service
└─2061 /usr/sbin/cupsd -l

sept. 17 06:25:04 serveur-debian systemd[1]: Started CUPS Scheduler.
lines 1-10…skipping…
● cups.service - CUPS Scheduler
Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2017-09-17 06:25:04 CEST; 3h 11min ago
Docs: man:cupsd(8)
Main PID: 2061 (cupsd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cups.service
└─2061 /usr/sbin/cupsd -l

sept. 17 06:25:04 serveur-debian systemd[1]: Started CUPS Scheduler.[/quote]

Cela dit, je vois maintenant dans mon explrateur de fichier le dossier ‘WORKGROUP’ ; par contre :
‘l’obtention de la liste des partages du serveur a échoué connexion refusée’.

il te manque encore les droits sur les partages ?

Je ne sais pas. Normalement tout fonctionnait avant la migration.
Est-ce que lors de la migration le fichier smbpasswd a été effacé ??

Non, le fichier est toujours là.

[quote]# # smbclient -L 172.16.10.1
WARNING: The “syslog” option is deprecated
Enter root’s password:
Connection to 172.16.10.1 failed (Error NT_STATUS_CONNECTION_REFUSED)[/quote]
J’ai déjà vu cette ligne là …

[quote]####### Authentication #######

“security = user” is always a good idea. This will require a Unix account

in this server for every user accessing the server. See

/usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html

in the samba-doc package for details.

security = user

You may wish to use password encryption. See the section on

‘encrypt passwords’ in the smb.conf(5) manpage before enabling.

encrypt passwords = true

If you are using encrypted passwords, Samba will need to know what

password database type you are using.

passdb backend = tdbsam

obey pam restrictions = yes

This boolean parameter controls whether Samba attempts to sync the Unix

password with the SMB password when the encrypted SMB password in the

passdb is changed.

unix password sync = yes

For Unix password sync to work on a Debian GNU/Linux system, the following

parameters must be set (thanks to Ian Kahan <kahan@informatik.tu-muenchen.de for

sending the correct chat script for the passwd program in Debian Sarge).

passwd program = /usr/bin/passwd %u
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .

This boolean controls whether PAM will be used for password changes

when requested by an SMB client instead of the program listed in

‘passwd program’. The default is ‘no’.

pam password change = yes

This option controls how unsuccessful authentication attempts are mapped

to anonymous connections

map to guest = bad user[quote]

[quote]#======================= Share Definitions =======================

[homes]
comment = Home Directories
browseable = no

By default, the home directories are exported read-only. Change the

next parameter to ‘no’ if you want to be able to write to them.

read only = no

File creation mask is set to 0700 for security reasons. If you want to

create files with group=rw permissions, set next parameter to 0775.

create mask = 0770

Directory creation mask is set to 0700 for security reasons. If you want to

create dirs. with group=rw permissions, set next parameter to 0775.

directory mask = 0770

By default, \server\username shares can be connected to by anyone

with access to the samba server.

The following parameter makes sure that only “username” can connect

to \server\username

This might need tweaking when using external authentication schemes

valid users = %S

Un-comment the following and create the netlogon directory for Domain Logons

(you need to configure Samba to act as a domain controller too.)

;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes

Un-comment the following and create the profiles directory to store

users profiles (see the “logon path” option above)

(you need to configure Samba to act as a domain controller too.)

The path below should be writable by all users so that their

profile directory may be created the first time they log on

;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

;[printers]
; comment = Imprimantes
; browseable = yes
; path = /var/spool/samba
; printable = yes
; guest ok = yes
; writable = no
; public = yes

Windows clients look for this share name as a source of downloadable

printer drivers

[print$]
; comment = Drivers pour imprimantes
; path = /var/lib/samba/printers
; browseable = yes
; read only = yes
; guest ok = yes
; writable = no
; write list = root

Uncomment to allow remote administration of Windows print drivers.

You may need to replace ‘lpadmin’ with the name of the group your

admin users are members of.

Please note that you also need to set appropriate Unix permissions

to the drivers directory for these users to have write rights in it

write list = root, @lpadmin

A sample share for sharing your CD-ROM with others.

;[cdrom]
; comment = Samba server’s CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

;[Packard_Bell]
; path = /media/diskexterne
; read only = no
; browseable = yes
; guest ok = no
; public = yes
; valid user = @xbox

[Donnees]
path = /media/Donnees_famille
read only = yes
write list = ordimac, liliminu, tristan, adminubuntu, matetefoot, adulte, xbox
browseable = yes
valid users = @donnees
create mask = 0770
directory mask = 0770

[Sauvegardes]
path = /media/Sauvegardes
read only = yes
write list = toto69
browseable = yes
valid users = @sauvegarde
create mask = 0770
directory mask = 0770

The next two parameters show how to auto-mount a CD-ROM when the

cdrom share is accesed. For this to work /etc/fstab must contain

an entry like this:

/dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0

The CD-ROM gets unmounted automatically after the connection to the

If you don’t want to use auto-mounting/unmounting make sure the CD

is mounted on /cdrom

; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom[/quote]

Je ne sais pas comment afficher les erreurs dans les logs du dist-upgrade.
Lors du apt-get upgrade

[quote]Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2017-09-16 20:29:13[/quote]

[quote]#root@serveur-debian:~# apt-get -f install
Lecture des listes de paquets… Fait
Construction de l’arbre des dépendances
Lecture des informations d’état… Fait
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
4 partiellement installés ou enlevés.
Après cette opération, 0 o d’espace disque supplémentaires seront utilisés.
Paramétrage de squid3 (3.5.23-5) …
squid.service is not active, cannot reload.
invoke-rc.d: initscript squid, action “reload” failed.
dpkg: erreur de traitement du paquet squid3 (–configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d’état 1
Paramétrage de nut-client (2.7.4-5) …
Job for nut-monitor.service failed because the control process exited with error code.
See “systemctl status nut-monitor.service” and “journalctl -xe” for details.
invoke-rc.d: initscript nut-client, action “restart” failed.
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-09-17 14:38:35 CEST; 26ms ago
Process: 1820 ExecStart=/sbin/upsmon (code=exited, status=1/FAILURE)

sept. 17 14:38:35 serveur-debian upsmon[1820]: Using power down flag file /etc/killpower
sept. 17 14:38:35 serveur-debian upsmon[1820]: Network UPS Tools upsmon 2.7.4
sept. 17 14:38:35 serveur-debian upsmon[1820]: Fatal error: insufficient power configured!
sept. 17 14:38:35 serveur-debian upsmon[1820]: Sum of power values…: 0
sept. 17 14:38:35 serveur-debian upsmon[1820]: Minimum value (MINSUPPLIES): 1
sept. 17 14:38:35 serveur-debian upsmon[1820]: Edit your upsmon.conf and change the values.
sept. 17 14:38:35 serveur-debian systemd[1]: nut-monitor.service: Control process exited, code=…tus=1
sept. 17 14:38:35 serveur-debian systemd[1]: Failed to start Network UPS Tools - power device m…ller.
sept. 17 14:38:35 serveur-debian systemd[1]: nut-monitor.service: Unit entered failed state.
sept. 17 14:38:35 serveur-debian systemd[1]: nut-monitor.service: Failed with result ‘exit-code’.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: erreur de traitement du paquet nut-client (–configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d’état 1
dpkg: des problèmes de dépendances empêchent la configuration de nut :
nut dépend de nut-client ; cependant :
Le paquet nut-client n’est pas encore configuré.

dpkg: erreur de traitement du paquet nut (–configure) :
problèmes de dépendances - laissé non configuré
dpkg: des problèmes de dépendances empêchent la configuration de nut-server :
nut-server dépend de nut-client (= 2.7.4-5) ; cependant :
Le paquet nut-client n’est pas encore configuré.

dpkg: erreur de traitement du paquet nut-server (–configure) :
problèmes de dépendances - laissé non configuré
Des erreurs ont été rencontrées pendant l’exécution :
squid3
nut-client
nut
nut-server
E: Sub-process /usr/bin/dpkg returned an error code (1)[/quote]
Squid3 râle car j’ai remis l’ancien fichier de conf je pense.
Quant à Nut c’est mon onduleur.
Donc aucun rapport avec Samba.

Et si je purgeais Samba ? apt-get --purge samba && apt-get install samba.

J’ai purgé samba et réinstallé la version à jour.

[quote]# systemctl status smbd
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: ena
Active: active (running) since Sun 2017-09-17 16:12:21 CEST; 24s ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Main PID: 3189 (smbd)
Status: "smbd: ready to serve connections…"
CGroup: /system.slice/smbd.service
├─3189 /usr/sbin/smbd
├─3190 /usr/sbin/smbd
├─3191 /usr/sbin/smbd
└─3195 /usr/sbin/smbd

sept. 17 16:12:21 serveur-debian systemd[1]: Starting Samba SMB Daemon…
sept. 17 16:12:21 serveur-debian systemd[1]: smbd.service: Supervising process 3
sept. 17 16:12:21 serveur-debian systemd[1]: Started Samba SMB Daemon.[/quote]
Je vais configurer les partages ce soir. On verra après.

J’ai ajouté la partie [Donnees] de l’ancien fichier smb.conf dans le nouveau.
C’est tout bon :slight_smile: