Linux problema al compartir archivos desde linux a windows

blitzkrieg

Coleccionista de Thinkpads
Se incorporó
28 Septiembre 2009
Mensajes
156
llevo un rato tratando de montar un pc viejo como servidor para descargas. elegí arch y estoy usando samba para compartir pero tengo el servicio smb.service se detiene inesperadamente luego de unos minutos y no entiendo qué estoy haciendo mal

cuando reviso el log de journalctl me sale esto:

Código:
Jan 28 19:14:53 archlinux smbd[353]: [2024/01/28 19:14:53.468301,  0] ../../source3/smbd/server.c:1746(main)
Jan 28 19:14:53 archlinux smbd[353]:   smbd version 4.19.4 started.
Jan 28 19:14:53 archlinux smbd[353]:   Copyright Andrew Tridgell and the Samba Team 1992-2023
Jan 28 19:14:53 archlinux systemd[1]: smb.service: Can't open PID file /run/samba.smbd/pid (yet?) after start: No such file or directory
Jan 28 19:16:23 archlinux systemd[1]: smb.service: start operation timed out. Terminating.
Jan 28 19:16:23 archlinux systemd[1]: smb.service: Failed with result 'timeout'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit smb.service has entered the 'failed' state with result 'timeout'.
Jan 28 19:16:23 archlinux systemd[1]: Failed to start Samba file server.
░░ Subject: A start job for unit smb.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit smb.service has finished with a failure.
░░
░░ The job identifier is 98 and the job result is failed.

el problema es ese archivo PID del que se queja? el smb.conf creo que está bien
 

Kitsune

Fanático
Se incorporó
5 Mayo 2006
Mensajes
1.029
el PID se supone es su misma ejecución, talves murio y no sabes porque, mira el log como comoento cosme.
por lo pronto ademas revisaria permisos, que usuario corre el proceso? tienes AppArmor?
 
Upvote 0

blitzkrieg

Coleccionista de Thinkpads
Se incorporó
28 Septiembre 2009
Mensajes
156
y el log de samba?
el log dice esto:

Código:
[2024/01/28 18:41:37.198321,  0] ../../source4/samba/server.c:633(binary_smbd_main)
  samba version 4.19.4 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2023
[2024/01/28 18:41:37.198485,  0] ../../lib/util/become_daemon.c:150(daemon_status)
  daemon 'samba' : Starting process...
[2024/01/28 18:41:37.222127,  0] ../../source4/samba/server.c:862(binary_smbd_main)
  At this time the 'samba' binary should only be used for either:
  'server role = active directory domain controller' or the rpc proxy with 'dcerpc endpoint servers = remote'
  You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
[2024/01/28 18:41:37.222213,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
  exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22

el smb.conf lo tengo así
Código:
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.


# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/%m.log

# Put a capping on the size of the log files (in Kb).
   max log size = 50



#============================ Share Definitions ==============================
[Share]
path = /mnt/ntfs/
available = yes
valid users = svr mainme
read only = no
browsable = yes
public = yes
writable = yes


el PID se supone es su misma ejecución, talves murio y no sabes porque, mira el log como comoento cosme.
por lo pronto ademas revisaria permisos, que usuario corre el proceso? tienes AppArmor?
lo ejecuto desde una cuenta con sudo, tengo entendido que entrar como root propiamente tal es un condoro y no lo he hecho. no tengo apparmor
 
Upvote 0

Miguelwill

I am online
Miembro del Equipo
MOD
Se incorporó
23 Febrero 2004
Mensajes
12.278
el log dice esto:

Código:
[2024/01/28 18:41:37.198321,  0] ../../source4/samba/server.c:633(binary_smbd_main)
  samba version 4.19.4 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2023
[2024/01/28 18:41:37.198485,  0] ../../lib/util/become_daemon.c:150(daemon_status)
  daemon 'samba' : Starting process...
[2024/01/28 18:41:37.222127,  0] ../../source4/samba/server.c:862(binary_smbd_main)
  At this time the 'samba' binary should only be used for either:
  'server role = active directory domain controller' or the rpc proxy with 'dcerpc endpoint servers = remote'
  You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
[2024/01/28 18:41:37.222213,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
  exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22

el smb.conf lo tengo así
Código:
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.


# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/%m.log

# Put a capping on the size of the log files (in Kb).
   max log size = 50



#============================ Share Definitions ==============================
[Share]
path = /mnt/ntfs/
available = yes
valid users = svr mainme
read only = no
browsable = yes
public = yes
writable = yes



lo ejecuto desde una cuenta con sudo, tengo entendido que entrar como root propiamente tal es un condoro y no lo he hecho. no tengo apparmor
exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22

ese es el error, en eso debes prestar atencion y ver que necesitas modificar
 
Upvote 0

VitouXY

Miembro Activo
Se incorporó
28 Diciembre 2021
Mensajes
15
Código:
testparm #-d 10

You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
Código:
#systemctl list-units --type=service #--state=running #--state=active
sudo systemctl start smbd nmbd
 
Última modificación:
Upvote 0

blitzkrieg

Coleccionista de Thinkpads
Se incorporó
28 Septiembre 2009
Mensajes
156
exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22

ese es el error, en eso debes prestar atencion y ver que necesitas modificar
Segun yo está bien como standalone y con el grupo de trabajo de windows. Aclaro que tengo problemas con smbd, no con samba (creo que subí el log incorrecto)
Código:
testparm #-d 10


Código:
#systemctl list-units --type=service #--state=running #--state=active
sudo systemctl start smbd nmbd
Hice eso pero sigue igual. nmbd y winbindd están activos y se ejecutan sin problema.

Ahora bien, si ejecuto smbd desde terminal (escribiendo
Código:
sudo smb
) funciona bien, no se cierra al minuto por timeout ni nada pero no es la gracia. Me di cuenta que al ejecutarlo de esta forma crea exitosamente el pidfile pero lo ubica en la carpeta /run/samba, mientras que el log de journalctl se queja de un pidfile inexistente pero en la ruta /run/samba.smbd/pid la cual no existe. Traté de crearla e iniciar el proceso usando
Código:
systemctl
pero ocurre lo mismo e incluso borra la carpeta luego del timeout
 
Upvote 0

VitouXY

Miembro Activo
Se incorporó
28 Diciembre 2021
Mensajes
15
Código:
Jan 28 19:14:53 archlinux systemd[1]: smb.service: Can't open PID file /run/samba.smbd/pid (yet?) after start: No such file or directory

En el archivo del servicio, como esta definido "PIDFile"?

Código:
~$ grep PIDFile /usr/lib/systemd/system/smb.service
PIDFile=/run/smbd.pid
 
Upvote 0

sndestroy

Digital Detox
Miembro del Equipo
MOD
Se incorporó
8 Abril 2009
Mensajes
1.785
Quizás no es muy "aporte", pero... ¿por qué no instalas OpenMediaVault y te olvidas del tema? Viene llegar y usar, todo se configura desde la interfaz web. Mi server/NAS personal es un Debian con varias cosas, entre ellas OMV que funciona impecable hace años.
 
Upvote 0

blitzkrieg

Coleccionista de Thinkpads
Se incorporó
28 Septiembre 2009
Mensajes
156
Quizás no es muy "aporte", pero... ¿por qué no instalas OpenMediaVault y te olvidas del tema? Viene llegar y usar, todo se configura desde la interfaz web. Mi server/NAS personal es un Debian con varias cosas, entre ellas OMV que funciona impecable hace años.
Te soy sincero, es primera vez que escucho de OpenMediaVault. Vi un par de videos de cómo funciona y me encantó! como tengo un día libre esta semana voy a echarle un vistazo.
Código:
Jan 28 19:14:53 archlinux systemd[1]: smb.service: Can't open PID file /run/samba.smbd/pid (yet?) after start: No such file or directory

En el archivo del servicio, como esta definido "PIDFile"?

Código:
~$ grep PIDFile /usr/lib/systemd/system/smb.service
PIDFile=/run/smbd.pid
Aparece tal cual está en tu post. Te doy las gracias por la ayuda pero creo que por ahora intentaré lo de OpenMediaVault. De todas formas respaldaré esta install para revisarla en el futuro cuando comprenda mejor linux y ver cuál fue mi condoro :zippypozo
 
Upvote 0

Miguelwill

I am online
Miembro del Equipo
MOD
Se incorporó
23 Febrero 2004
Mensajes
12.278
tu dale, esas distribuciones estan hechas para poder configurar estos accesos de la forma mas funcional posible y asi ayudar a compartir los recursos que sean necesarios (smb para windows, o nfs para compartir con otros linux)
configurar el smb a pelo/a mano es mas necesario cuando uno quiere compartir en un sistema que ya esta siendo usado para otra cosa y el smb es solo algo adicional
 
Upvote 0
Subir