I couldn't start Samba.

Posted on 2000-03-12
Last Modified: 2013-12-15
In Red Hat Linux 6.0, I uninstalled and reinstalled Samba(.rpm) from Red Hat CD.
I checked /etc/services file and modified /etc/inetd.conf and even rebooted my system. In /etc/rc.d/init.d directory I ran command "./smb start"
and smbd daemon is not there when I use "ps" command to check. issue command "./smb stop" it says Shutting down SMB service: [Failed]. Can somebody help?

Question by:aicc
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 2609748
check if you have /etc/smb.conf in palce. or try out at commandline rpokmpt the real startup line from /etc/rc.d/init.d/smb, and see what you get.

Author Comment

ID: 2609798
The /etc/smb.conf is in place. I don't know what "rpokmpt" means. I ran command "/usr/sbin/smbd -D". I still can not see the daemon.


Expert Comment

ID: 2609850
Check out the /var/log/samba directory. There are the log files, one of them might tell you what's wrong.

Also check out /var/log/messages right after starting Samba. The error might be there too.
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

LVL 40

Expert Comment

ID: 2609866
What did you change in inetd.conf? Samba runs better as a full time daemons and you don't want to be starting smbd or nmbd from inetd. If you did allow inetd to manage smbd & nmbd, you won't "see them running" until a windows client tries to use a Samba service and they'll disappear as soon as the client closes the connection. Furthermore, if the services are registered with inetd, the ports are owned by inetd and you can't just run smbd & nmbd.

If it doesn't start when you use "/usr/sbin/smbd -D" and you don't have inetd managing smbd & nmbd, then the likely cause is that something is wrong with the smb.conf file or it's not in the right place. Check your samba logs, there'll probably be something there that will provide a clue as to what the problem is.

Author Comment

ID: 2610061
Thank you guys!
in /var/log/samba/smb.log file, I read Lib/util_sock.c:open_socket_in(671) bind failed on port 139 socket_addr= (address already in use)

when I reboot the machine,
in /var/log/messages file I read:
inetd[357]: netbios/udp server failing (looping), service terminated.

I don't know how to fix it. Please help!

what I did on inetd.conf file was:
uncomment the swat line,
add line "netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd" and "netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd"
LVL 40

Expert Comment

ID: 2610121
Go into /etc/inetd.conf and remove the lines:

netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd

Then do "ps -ef | grep inetd | grep -v grep". That'll give you the process info for inetd. Using the process ID to replace nnn below (first number from the left), issue the command "kill -HUP nnn". That'll cause inetd to reread its config file and it'll quit trying to manage the netbios ports (137 & 139).

You should then be able to start smbd & nmbd from the command line. Oh yeah, leave the swat line alone, it's okay for it to be there.

Author Comment

ID: 2610351
thanks. you are the man.
but I still can not see the shared directory(Linux share). on a win98, I can see the Linux server icon but can't access it. right click on the icon and select properies, it says "the server \\bach (linux) does not accept remote requests.

on Linux side:
guest account  nobody
share is bill
shared directory is   /home/bill
guest ok = Yes
host allow   is empty.

What I missed.

LVL 40

Expert Comment

ID: 2610432
Okay, we're making progress... At least Samba runs now...

Lets try this for a start. Shut Samba down (/etc/rc.d/init.d/smb stop), save your existing config file (mv /etc/smb.conf /etc/smb.conf-save), then paste what's below into a new /etc/smb.conf file. It's a really basic Samba config that I'm pretty sure will work.

You do need to be sure that /etc/smbpasswd exists and that your windows login name and password are the same as your linux logon name and password. Don't use a mixed case username as windows won't preserve case when authenticating against the Samba server. If you don't have the smbpasswd file create it with, surpisingly, "smbpasswd -a username". There is a way around having to use encrypted passwords, but unless you are into windows registry hacks...

Now run "testparm" to be sure that the config is okay, and then re-start Samba.
You should see the server in network neighborhood and there should be a share labeled with your username. Once you've got basic stuff working you can get as fancy as you like with the smb.conf file (modifying your saved smb.conf file and letting Samba use that).

---snip, snip---
    workgroup = compcntr
    server string = Linux Samba
    printcap name = /etc/printcap
    load printers = yes
    debug level = 0
    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    encrypt passwords = yes
    smb passwd file = /etc/smbpasswd
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
    os level = 0
    comment = Home Directories
    browseable = no
    writable = yes
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = no
    writable = no
    printable = yes
LVL 40

Expert Comment

ID: 2610434
Rat's, I hit submit too soon... Change the workgroup name to what you've already set as the workgroup in windows.

Author Comment

ID: 2610543
Adjusted points to 40

Author Comment

ID: 2610544
Mr. jlevie:
Wonderful! You are the real man!!
I think what i missed was the password part. maybe the socket option is also important.

Thank you again.

LVL 40

Expert Comment

ID: 2610580
The encrypted passwords are important, bu I think it was the empty "hosts allow" that was your first problem. If it had just been the passwords, you'd have gotten an "access denied" rather than the "not accepting requests". However, I was pretty sure that you were unlikely to have known to enable ecrypted passwords, so I wanted to short-circuit the intial "get it working" and reduce the frustration by using a "known good" config.

The socket option is just a good idea that rather dramatically improves file transfers between the systems, again it's one of those things that are documented but aren't exactly general knowledge.
LVL 40

Accepted Solution

jlevie earned 40 total points
ID: 2619814
If everything is working ok now, it would be appreciated if you'd select a comment you like as the answer and grade it.

Author Comment

ID: 2620235
Sorry This is my first time to use this side. I didn't know about the acceptable answer. Thank you for telling me this.



Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question