Koozali.org: home of the SME Server

Samba confusion [SOLVED]

arthurhanlon

Samba confusion [SOLVED]
« on: August 21, 2006, 12:58:26 PM »
Hi there,

I spoke with RayMitchell in http://forums.contribs.org/index.php?topic=25227.0 and shortly after noticed this post http://forums.contribs.org/index.php?topic=32938.0.

Thought that it was very strange and installed a new stock SME 7.0 and noticed that there was no /etc/smb.conf file linking to /etc/samba/smb.conf and all smb.conf template fragments are located at /etc/e-smith/templates/etc/smb.conf/ and not /etc/e-smith/templates/etc/samba/smb.conf/

When I expand-template /etc/smb.conf it creates a new file /etc/smb.conf and when I expand-template /etc/samba/smb.conf it does nothing.

Is it just me or have I missed something along the way. My apologies for wasting time if this is a simple solution.

Thanks,
Arthur

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: Samba confusion
« Reply #1 on: August 21, 2006, 01:13:25 PM »
Quote from: "arthurhanlon"

When I expand-template /etc/smb.conf it creates a new file /etc/smb.conf and when I expand-template /etc/samba/smb.conf it does nothing.

Is it just me or have I missed something along the way. My apologies for wasting time if this is a simple solution.


http://bugs.contribs.org/show_bug.cgi?id=87

Note that expand-template will leave the current file alone if the result of the template expansion is the same as the existing file.
............

arthurhanlon

Samba confusion [SOLVED]
« Reply #2 on: August 21, 2006, 05:41:35 PM »
Thanks for the quick response Gordon.

This bug report mentions a symlink from /etc/smb.conf -> /etc/samba/smb.conf but I see no such link on my system.

If I had a requirement to produce a custom template fragment for this, where would I place it and how would I expand the template so that the actual file that was used by Samba was changed?

If I expand /etc/smb.conf will it not overwrite any symlink that was to be in place already?

Sorry, but am still trying to get my head around the templating and it's just starting to sink into my thick skull  :-?

Arthur

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Samba confusion [SOLVED]
« Reply #3 on: August 22, 2006, 12:35:34 AM »
Quote from: "arthurhanlon"

If I had a requirement to produce a custom template fragment for this, where would I place it and how would I expand the template so that the actual file that was used by Samba was changed?


Put the template fragment in /etc/e-smith/templates-custom/etc/smb.conf and then run "signal-event workgroup-update" and the correct things will happen.

I have also put in a change so that expand-template /etc/smb.conf does the right thing. I'll push that to smeupdates-testing.

The change is simple - create a file /etc/e-smith/templates.metadata containing the single line OUTPUT_FILENAME="/etc/samba/smb.conf" which says that although the templates are in /etc/smb.conf, we should generate the /etc/samba/smb.conf file.

Quote from: "arthurhanlon"

If I expand /etc/smb.conf will it not overwrite any symlink that was to be in place already?


Possibly, but it won't do anything useful either, as you have found. Another fix would be to move all templates to /etc/samba/smb.conf, but that will affect quite a few contribs.

Quote from: "arthurhanlon"

Sorry, but am still trying to get my head around the templating and it's just starting to sink into my thick skull :-?


No worries. Make sure you read the developers guide - linked from the Development page. I spent a lot of time explaining the templates system in that guide.
............