I couldn't start Samba.

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?

Who is Participating?
jlevieConnect With a Mentor Commented:
If everything is working ok now, it would be appreciated if you'd select a comment you like as the answer and grade it.
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.
aiccAuthor Commented:
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.

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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.
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.
aiccAuthor Commented:
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"
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.
aiccAuthor Commented:
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.

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
Rat's, I hit submit too soon... Change the workgroup name to what you've already set as the workgroup in windows.
aiccAuthor Commented:
Adjusted points to 40
aiccAuthor Commented:
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.

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.
aiccAuthor Commented:
Sorry This is my first time to use this side. I didn't know about the acceptable answer. Thank you for telling me this.


All Courses

From novice to tech pro — start learning today.