Koozali.org: home of the SME Server

affa wins/smbfs/cifs name resolution

Offline gklaus

  • 11
  • +0/-0
affa wins/smbfs/cifs name resolution
« on: June 14, 2012, 12:36:23 PM »
After upgrading to sme version 8, the affa backup jobs pulling data from workstations to the backup server failed. The reason had to do with smb/cifs name resolution and is easily fixed: add 'wins' to the 'hosts:'-line in nsswitch.conf. Those interested please find details below.

Initially, backup jobs failed with this report:

Mon_Jun__4_17:30:01[27802]:_Mounting_//WINXP-ID/c$_to_/mnt/id
Mon_Jun__4_17:30:01[27802]:_Exec_Out:_mount:_unknown_filesystem_type_'smbfs'

The reason was that smbmount is no longer available. Switching to cifs...

db affa setprop id AutomountOptions '-t smbfs -o credentials=...'
to
db affa setprop id AutomountOptions '-t cifs -o credentials=...'

...brought back the old problem that netbios names were not resolved and (fixed) IP-addresses needed:

Mon_Jun__4_19:38:32[30025]:_Mounting_//WINXP-ID/c$_to_/mnt/id
Mon_Jun__4_19:38:32[30025]:_Exec_Out:_mount_error:_could_not_resolve_address_for_WINXP-ID:_Name_or_service_not_known
Mon_Jun__4_19:38:32[30025]:_Exec_Out:_No_ip_address_specified_and_hostname_not_found

Reading a couple of bug reports on related issues taught me that sme server resolves hostnames by consulting the hosts file and dns but not wins. Editing /etc/nsswitch.conf...

hosts:       files dns
to
hosts:       files dns wins

...solves the problem.

Hope this might help someone.

Do you think reporting a bug to ask to add wins name resolution to the default configuration would be a good idea? I myself found it confusing that “ping 'netbios-name'” works on the workstations but not on the server, even though the server 'sees' the workstations' netbios names when the smbtree command is used.

Offline chris burnat

  • ****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Re: affa wins/smbfs/cifs name resolution
« Reply #1 on: June 14, 2012, 02:35:51 PM »

Hope this might help someone.
I certainly will, thanks.

Quote
Do you think reporting a bug to ask to add wins name resolution to the default configuration would be a good idea? I myself found it confusing that “ping 'netbios-name'” works on the workstations but not on the server, even though the server 'sees' the workstations' netbios names when the smbtree command is used.

Affa is no longer supported, no maintainer on board.  However, It may not always be so, and your input should really be with the rest of the post about Affa on the Bugtracker.  In this way, a future maintainer (wishing...) will find this information easily. When opening a bug, ensure that you place it under 8.xx contribs section, and provide all information, not just a link to the Forums.
Thanks.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline gklaus

  • 11
  • +0/-0
Re: affa wins/smbfs/cifs name resolution
« Reply #2 on: June 28, 2012, 05:14:04 PM »
Thanks for the response. It's on the bug tracker now (no. 7013).

Offline gklaus

  • 11
  • +0/-0
Re: affa wins/smbfs/cifs name resolution
« Reply #3 on: June 28, 2012, 06:45:20 PM »
Just discovered that, unfortunately, the solution is a bit more complicated:

- The file /etc/nsswitch.conf is overwritten each time an update is performed and the post-upgrade event is signaled.

- If the inclusion of wins in the name resolution shall persist updates, a custom template for the nsswitch.conf file must be created, so that the actual nsswitch.conf file is recreated in the intended way during each update. (Simply editing the template will not be sufficient since the tamplates may be updated from time to time with new default versions -- according the manual).

- Create a new directory nsswitch.conf for the template in the template custom branch at /etc/e-smith/templates-custom/etc/

- Copy the template file /etc/e-smith/templates/etc/nsswitch.conf/10files to the CUSTOM branch's new directory /etc/e-smith/templates-custom/etc/nsswitch.conf/

- Edit the newly copied custom template /etc/e-smith/templates-custom/etc/nsswitch.conf/10files:

change the line

hosts:    { ($AccessType eq "off") ? "files" : "files dns" }
to
hosts:    { ($AccessType eq "off") ? "files" : "files dns wins" }

- Use signal-event post-upgrade and signal-event reboot to have the new custom template rewrite the nsswitch.conf

This solution seems to work (for now...  :-)), but I am not at all familiar with the sme-server's template and database system, so please correct the above if necessary.

Offline chris burnat

  • ****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Re: affa wins/smbfs/cifs name resolution
« Reply #4 on: June 29, 2012, 01:36:09 AM »
Just discovered that, unfortunately, the solution is a bit more complicated:

Please follow up  at Bugzilla: http://bugs.contribs.org/show_bug.cgi?id=7013
Posting here and there may lead to confusion.
Thanks.
« Last Edit: June 29, 2012, 01:40:24 AM by chris burnat »
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline gklaus

  • 11
  • +0/-0
Re: affa wins/smbfs/cifs name resolution
« Reply #5 on: June 29, 2012, 11:13:43 AM »
Already done. I'll keep information here and there in sync so there should be no confusion. It can't hurt to have the information in both places, surely.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: affa wins/smbfs/cifs name resolution
« Reply #6 on: June 29, 2012, 11:34:49 AM »
gklaus

Quote
It can't hurt to have the information in both places, surely.

Well if a bug report has now been opened, pertinent information should be contained only in one place, and posters should be encouraged to add to the bug report rather than the forum.
Once a bug has been opened from a forum query, then a little note should be added to the forum which says "all follow up to the bug report only, please."

Not everyone (else) will add info to both the bug report and the forum, and by keeping the forum thread "alive", posters may update the forum and not add that info to the bugzilla thread.
There seems to be a reluctance among some people to use bugzilla, as far as I'm concerned, if they can use the forums and sme server, then they are capable of easily using bugzilla.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline gklaus

  • 11
  • +0/-0
Re: affa wins/smbfs/cifs name resolution
« Reply #7 on: June 29, 2012, 01:08:56 PM »
OK, I see your point.

I'm not surprised some people prefer the forum, however, and I don't think it is because bugzilla is a little less convenient to use.

Anyway:

Please, dear readers of this thread, do not act on the technical information above before also consulting http://bugs.contribs.org/show_bug.cgi?id=7013, and please post any comments only there.