LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   I must of done it wrong for Samba (https://www.linuxquestions.org/questions/linux-networking-3/i-must-of-done-it-wrong-for-samba-760354/)

AndeAnderson 10-07-2009 12:22 PM

I must of done it wrong for Samba
 
I am really stuck. I was attempting to re-install samba, after using my Synaptics Package Manager to remove it, when I got the strangest error.

It tells me:
Quote:

E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up samba-common (2:3.2.5-4lenny6) ...
Not replacing deleted config file /etc/samba/smb.conf
chmod: cannot access `/etc/samba/smb.conf': No such file or directory
dpkg: error processing samba-common (--configure):
The Samba directory is empty. I'm a little confused here. Doesn't the installation process install the files needed for the application to work?

If not, then how do I install the missing files?

Thanks

camorri 10-07-2009 12:39 PM

Quote:

Doesn't the installation process install the files needed for the application to work?
Yes it should.

Were you installing the packages as root user? Root is the only user with write access to the locations the files go to.

salasi 10-07-2009 01:59 PM

Quote:

Originally Posted by AndeAnderson (Post 3711204)
The Samba directory is empty.

By this, I take it you do mean the samba installation directory, and not /etc/samba.

/etc/samba should contain the configuration file(s). Possibly if you have edited /etc/samba/smb.conf the permissions are not allowing the package manager to move/remove it, so you want to have a look if anything is really there, or not.

Here is an approximate list of the files installed by samba (this isn't for your distro -its SuSE- and there will be minor differences)
Code:

/etc/init.d/nmb
/etc/init.d/smb
/etc/logrotate.d/samba
/etc/pam.d/samba
/etc/samba/smbpasswd
/etc/samba/smbusers
/etc/slp.reg.d
/etc/slp.reg.d/samba.reg
/etc/sysconfig/SuSEfirewall2.d/services/netbios-server
/etc/sysconfig/SuSEfirewall2.d/services/samba-server
/etc/xinetd.d/swat
/lib/security/pam_smbpass.so
/usr/bin/smbstatus
/usr/lib/samba
/usr/lib/samba/auth
/usr/lib/samba/auth/script.so
/usr/lib/samba/config
/usr/lib/samba/de.msg
/usr/lib/samba/en.msg
/usr/lib/samba/fi.msg
/usr/lib/samba/fr.msg
/usr/lib/samba/it.msg
/usr/lib/samba/ja.msg
/usr/lib/samba/nl.msg
/usr/lib/samba/pl.msg
/usr/lib/samba/rpc
/usr/lib/samba/tr.msg
/usr/lib/samba/vfs
/usr/lib/samba/vfs/audit.so
/usr/lib/samba/vfs/cacheprime.so
/usr/lib/samba/vfs/cap.so
/usr/lib/samba/vfs/default_quota.so
/usr/lib/samba/vfs/expand_msdfs.so
/usr/lib/samba/vfs/extd_audit.so
/usr/lib/samba/vfs/fake_perms.so
/usr/lib/samba/vfs/fileid.so
/usr/lib/samba/vfs/full_audit.so
/usr/lib/samba/vfs/netatalk.so
/usr/lib/samba/vfs/readahead.so
/usr/lib/samba/vfs/readonly.so
/usr/lib/samba/vfs/recycle.so
/usr/lib/samba/vfs/shadow_copy.so
/usr/lib/samba/vfs/shadow_copy2.so
/usr/lib/samba/vfs/smb_traffic_analyzer.so
/usr/lib/samba/vfs/streams_depot.so
/usr/lib/samba/vfs/streams_xattr.so
/usr/lib/samba/vfs/syncops.so
/usr/lib/samba/vfs/xattr_tdb.so
/usr/sbin/nmbd
/usr/sbin/rcnmb
/usr/sbin/rcsmb
/usr/sbin/smbd
/usr/sbin/swat
/usr/share/man/man1/smbstatus.1.gz
/usr/share/man/man5/smbpasswd.5.gz
/usr/share/man/man8/nmbd.8.gz
/usr/share/man/man8/smbd.8.gz
/usr/share/man/man8/swat.8.gz
/usr/share/man/man8/vfs_audit.8.gz
/usr/share/man/man8/vfs_cacheprime.8.gz
/usr/share/man/man8/vfs_cap.8.gz
/usr/share/man/man8/vfs_catia.8.gz
/usr/share/man/man8/vfs_commit.8.gz
/usr/share/man/man8/vfs_default_quota.8.gz
/usr/share/man/man8/vfs_extd_audit.8.gz
/usr/share/man/man8/vfs_fake_perms.8.gz
/usr/share/man/man8/vfs_full_audit.8.gz
/usr/share/man/man8/vfs_gpfs.8.gz
/usr/share/man/man8/vfs_netatalk.8.gz
/usr/share/man/man8/vfs_notify_fam.8.gz
/usr/share/man/man8/vfs_prealloc.8.gz
/usr/share/man/man8/vfs_readahead.8.gz
/usr/share/man/man8/vfs_readonly.8.gz
/usr/share/man/man8/vfs_recycle.8.gz
/usr/share/man/man8/vfs_shadow_copy.8.gz
/usr/share/man/man8/vfs_smb_traffic_analyzer.8.gz
/usr/share/man/man8/vfs_streams_depot.8.gz
/usr/share/man/man8/vfs_streams_xattr.8.gz
/usr/share/man/man8/vfs_xattr_tdb.8.gz
/usr/share/omc/svcinfo.d/nmb.xml
/usr/share/omc/svcinfo.d/smb.xml
/usr/share/samba
/usr/share/samba/swat
/usr/share/samba/swat/help
/usr/share/samba/swat/help/welcome-no-samba-doc.html
/usr/share/samba/swat/images
/usr/share/samba/swat/images/globals.gif
/usr/share/samba/swat/images/home.gif
/usr/share/samba/swat/images/passwd.gif
/usr/share/samba/swat/images/printers.gif
/usr/share/samba/swat/images/samba.gif
/usr/share/samba/swat/images/shares.gif
/usr/share/samba/swat/images/status.gif
/usr/share/samba/swat/images/viewconfig.gif
/usr/share/samba/swat/images/wizard.gif
/usr/share/samba/swat/include
/usr/share/samba/swat/include/footer.html
/usr/share/samba/swat/include/header.html
/usr/share/samba/swat/lang
/usr/share/samba/swat/lang/ja
/usr/share/samba/swat/lang/ja/help
/usr/share/samba/swat/lang/ja/help/welcome.html
/usr/share/samba/swat/lang/ja/images
/usr/share/samba/swat/lang/ja/include
/usr/share/samba/swat/lang/ja/js
/usr/share/samba/swat/lang/tr
/usr/share/samba/swat/lang/tr/help
/usr/share/samba/swat/lang/tr/help/welcome.html
/usr/share/samba/swat/lang/tr/images
/usr/share/samba/swat/lang/tr/images/globals.gif
/usr/share/samba/swat/lang/tr/images/home.gif
/usr/share/samba/swat/lang/tr/images/passwd.gif
/usr/share/samba/swat/lang/tr/images/printers.gif
/usr/share/samba/swat/lang/tr/images/samba.gif
/usr/share/samba/swat/lang/tr/images/shares.gif
/usr/share/samba/swat/lang/tr/images/status.gif
/usr/share/samba/swat/lang/tr/images/viewconfig.gif
/usr/share/samba/swat/lang/tr/include
/usr/share/samba/swat/lang/tr/js
/var/lib/samba/drivers
/var/lib/samba/drivers/IA64
/var/lib/samba/drivers/W32ALPHA
/var/lib/samba/drivers/W32MIPS
/var/lib/samba/drivers/W32PPC
/var/lib/samba/drivers/W32X86
/var/lib/samba/drivers/WIN40
/var/lib/samba/drivers/x64
/var/lib/samba/netlogon
/var/lib/samba/profiles

as you can see, most of the files go into /usr with a few into /var and /etc.

AndeAnderson 10-07-2009 02:24 PM

Quote:

Originally Posted by camorri (Post 3711225)
Yes it should.

Were you installing the packages as root user? Root is the only user with write access to the locations the files go to.

Yes, I am logged in as root. I got tired of not being able to do anything when logged in as a user. So, I just login as root.

AndeAnderson 10-07-2009 02:39 PM

Sorry,

I should have been clearer. I should have said '/etc/samba/'. the only file in that folder was dhcp.conf. The error message only mentioned the '/etc/samba/smb.conf' file as missing.

There is an smb.conf in '/usr/share/samba/'. Apparently, the installer just ignores this one.

Any suggestions on how to actually get samba to re-install?

Thanks

It works now.

I copied the smb.conf file from '/usr/share/samba/' to '/etc/samba/'. That allowed samba to accomplish the installation. Now, all I have to do is get it set-up to share files and folders with my Windows computers. Thanks to all for their help.

AndeAnderson 10-09-2009 03:44 PM

Try Try Again
 
I don't understand what has happened. I just uninstalled Samba and immediately re-installed it.

Now, it can see my Windows Network. I've been trying to do that for quite a few days now, with no success. Yet, now it decided to work. :rolleyes:

The only one I can't access is my XP Pro box. But, I understand that is more involved.

And, I still can not see any shared folders/files on the Linux system.

One step at a time will succeed in the end.

camorri 10-10-2009 05:16 AM

Just a suggestion. To verify the correctness of your smb.conf file, there is a command called 'testparm'. It will validate the syntax of the config file. You can run it from the command line.

Understand, it will make sure you don't have glaring errors that stop samba form starting up. It can not validate if you have things defined at all, ie if you leave out a share, it will not tell you. It just makes sure the .conf file can load and at least start up.

Here is what it looks like when it works.

Quote:

testparm /etc/samba/smb.conf
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[pdf-gen]"
Processing section "[Music]"
Processing section "[Pictures]"
Processing section "[homes]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
After pressing enter, it will dump out the shares you have.

Hope this helps while you are working on adding the shares...

AndeAnderson 10-12-2009 07:02 PM

Samba just quit?
 
It's me again. On Friday evening Samba had started working and I could interact with my windows computers from my Linux system. But, not from Windows to the Linux. That was OK because I just needed to be able to transfer from the Linux to the Windows and access the Printers.

Tonight, I came back my Linux computer and Samba had quit working??? I tried a re-install and no luck. Samba just will not interface with my network again. The only change I did was to add a new user.

This is making absolutely no sense. :scratch:

Here are the results of my 'testparm':

Quote:

Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
workgroup = ******
server string = %h server
obey pam restrictions = Yes
passdb backend = tdbsam
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
panic action = /usr/share/samba/panic-action %d

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

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
Any suggestions?

Thanks

camorri 10-13-2009 09:08 AM

Quote:

I tried a re-install and no luck.
This is the wrong approach ( this is a windbloze approach ) when things stop working in linux. If it was installed correctly, I assume it must have been since it did work. Now we don't know.

What did you do when you tried to re-install?

Please test your smb.conf file with testparm. Adding a user should have no effect on the two dameons that run, smbd and nmbd.

Find out if the dameons are running. Here is how.

From a terminal, run the commands, one at a time, 'ps aux | grep smbd' and 'ps aux | grep nmbd'. Here is what it looks like on my system.

Quote:

ps aux | grep smbd
root 7774 0.0 0.2 17384 2856 ? Ss 09:51 0:00 smbd -D
root 7782 0.0 0.1 17384 1096 ? S 09:51 0:00 smbd -D
cliff 9568 0.0 0.0 3224 772 pts/1 R+ 10:04 0:00 grep smbd
[cliff@Duelie:~]$ ps aux | grep nmbd
root 7783 0.0 0.1 10224 1796 ? Ss 09:51 0:00 nmbd -D
cliff 9595 0.0 0.0 3224 772 pts/1 S+ 10:05 0:00 grep nmbd
If either damenon is missing, then you probably have a problem with the smb.conf file. Testparm should help out there. If the dameons are running, something else is wrong.

Since you may have hosed up somthing trying to re-install, what you did there is important.

Let me know...

AndeAnderson 10-13-2009 11:00 AM

I posted the results of the 'testparm' in the previous post.

Here it is:

Quote:

Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
workgroup = ******
server string = %h server
obey pam restrictions = Yes
passdb backend = tdbsam
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
panic action = /usr/share/samba/panic-action %d

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

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
Since I do not know Linux very well the results don't mean much outside of 'global]
workgroup = ******'. I still have not found any documentation for the actual Debian smb.conf sections. Most documentation deals with a Network with a Domain Server. There is very little about a plain Peer-To-Peer Workgroup LAN.

Would Samba still work with Debian if I tried a Generic Samba smb.conf?

The commands you specified for checking the daemons returned:

Quote:

ahwebs:/home/debian# ps aux | grep smbd
root 4038 0.0 0.0 3116 728 pts/1 R+ 11:33 0:00 grep smbd
ahwebs:/home/debian# ps aux | grep nmbd
root 4041 0.0 0.0 3116 732 pts/1 S+ 11:34 0:00 grep nmbd
Those results look completely different from yours and don't mean much to me.

How would the daemons get started?

I don't understand how I could hose anything by completely removing the application and re-installing it. Once Samba started working I was afraid to change anything.

I'll be glad once I manage to get a grip on the acronyms and naming conventions of Linux. :Pengy:

camorri 10-13-2009 12:43 PM

Your dameons are not running. If you look at my results, there are 3 lines for smbd, I ran the command as a regular user. The line with 'grep' in it is my process greping for smbd. The other lines are the process running as with root permissions. Similar for nmbd.

This is the only result you got, so neither daemon is running. Testparm doesn't appear to be complaining about your smn.conf file, although that does not mean there is not an issue with it.

Is your workgroup name really ****** or have you removed it for posting purposes. I don't think the name you give your workgroup is all that significant, as long as it matches on each machine you want belonging to each work group. I would however not use a string of * for a workgroup name.

I installed Webmin to run and maintain samba. It has a nice graphical interface, seen through your web browser. You can see through it if the daemons are running, stop, start and restart them if you are making changes to the /etc/smb.conf file.

See this tutorial for a basic setup. It shows you how to manually start samba without restarting your system.

http://www.linuxquestions.org/linux/...k_File_Sharing

Quote:

How would the daemons get started?
They start when samba is started, the tutorial shows you...

Quote:

I don't understand how I could hose anything by completely removing the application and re-installing it. Once Samba started working I was afraid to change anything.
Removing and a successful re-install should not cause any problems. From your earlier post I understood the removal, re-install was not successful. If it was, then have a look through the tutorial, and see how far you can get.

Quote:

Once Samba started working I was afraid to change anything.
We all have been there. Most of the bugs I created for myself were things where one daemon or the other would not start. There are log files to help.

Here are two :
Quote:

/var/log/samba/log.nmbd
/var/log/samba/nmbd.log
And for smbd
Quote:

/var/log/samba/log.smbd
/var/log/samba/smbd.log
Usually the last few lines contain information pointing at the errors.

AndeAnderson 10-13-2009 03:58 PM

I installed Webmin and looked around my system.

Samba shows as installed and is listed as part of the start-up process. However, after the system finishes booting up the Samba Service is not running.

No matter what command I use, Samba will not start. I have tried a every combination of commands I could find to allow me to stop, start, or restart Samba. Everyone of them give me the same error:

Quote:

ahwebs:/home/debian# ps aux | grep smbd
root 4042 0.0 0.0 3116 736 pts/1 S+ 16:45 0:00 grep smbd
ahwebs:/home/debian# start samba
bash: start: command not found
ahwebs:/home/debian# samba start
bash: samba: command not found
ahwebs:/home/debian# cd /etc/samba/
ahwebs:/etc/samba# samba start
bash: samba: command not found
ahwebs:/etc/samba# start samba
bash: start: command not found
ahwebs:/etc/samba# start smb
bash: start: command not found
ahwebs:/etc/samba# smb start
bash: smb: command not found
ahwebs:/etc/samba#
You said
Quote:

I installed Webmin to run and maintain samba. It has a nice graphical interface, seen through your web browser. You can see through it if the daemons are running, stop, start and restart them if you are making changes to the /etc/smb.conf file.
I tried to find out how to use Webmin to restart Samba and to see if the daemons are running. But, the documentation appears to be like all of the other Linux applications. Very little actual instruction on how to use it.

What should I do next to try and get Samba working?

Thanks

camorri 10-13-2009 06:54 PM

I opened a konsole, did a 'su' and entered the root password. Then I ran these commands. They work.

Quote:

# samba start
Starting SMB services:
Starting NMB services:
[root@Duelie cliff]# samba stop
Shutting down SMB services: [ OK ]
Shutting down NMB services: [ OK ]
[root@Duelie cliff]# samba restart
Shutting down SMB services: [FAILED]
Shutting down NMB services: [FAILED]
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
The only reason I can think of nothing seems to work, is your path for the system is messed up somehow. When you see 'command not found', the system looks through the path defined for the user, and tries to find the command. Not found means just that.

So, to find out what path is set for a user ( including root ) in a konsole run the command 'echo $PATH' ( without the quotes, and watch the case, case matters in linux ).

Here is what I see for user root.

Quote:

echo $PATH
/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/qt4/bin:/usr/bin:/opt/kde3/bin:/opt/real/RealPlayer
These directories are all searched when I enter a command as root. The : is the separator.

My system displays an OK when a command for samba works, and a FAILED when it does not.

Webmin. Webmin on my system has 'Restart Samba Server' and 'Stop Samba Server' buttons. They will restart and stop a working server. I also have installed Swat. It gives you even more control and status displays. On the status panel for swat, it displays the current status of the dameons, and supplies more buttons for control. It also shows active connections on shares.

Swat also installs a lot of documentation. There is a lot to read about samba.

What I think you need to do is have a look through the logs I mentioned earlier. There has to be a reason the daemons are not starting. If they start, and fail, there will be information in the logs.

If you are confused by the messages, post what you think might me relevant, and we'll have a look.

Let me know...

AndeAnderson 10-14-2009 11:15 AM

SWAT works a lot better than Webmin, for me.

SWAT shows that the smbd and nmbd daemons are running. I can restart them.

My default path shows as: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

What will be my next step to resolving the issue of Samba not working? :scratch:

Thanks

camorri 10-14-2009 12:36 PM

That is interesting. When you ran the ps aux | grep smdb command, the daemons were not running. ps shows running processes, and is a reliable way of determining if something is running.

Swat is a very nice tool, and makes administering the system easier. I would bet you restarted the system between the ps command and installing swat. That would try to start up samba.

With the two daemons running, what do you see from a windoze machine? Go to Network Neighborhood and see if you can see the linux system.

If not, then we need to back up, and find out if you have IP connectivity between the two machines.

To do a ping, you open a command console on either system. Then you enter the command 'ping ipaddressoftheothermachine' example. ping 192.168.0.1 This will produce some output. Here is what a successful ping looks like.

Quote:

ping 192.168.1.20
PING 192.168.1.20 (192.168.1.20) 56(84) bytes of data.
64 bytes from 192.168.1.20: icmp_seq=1 ttl=128 time=1.55 ms
64 bytes from 192.168.1.20: icmp_seq=2 ttl=128 time=0.212 ms
64 bytes from 192.168.1.20: icmp_seq=3 ttl=128 time=0.214 ms
This is a good one. If it fails, you usually see a message like 'Destination unreachable'.

Let me know...


All times are GMT -5. The time now is 03:35 PM.