Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: stabilys on November 11, 2005, 11:21:16 AM
-
Help! :oops:
Sorry to start like that but I'm stuck, and didn't get any replies to my post in August last yet.
Scenario: E-Smith 6 with Yum and patches. Using 6 as need support for Compaq RAID controller missing in 6.01
Require to change smb.conf to support an accounts database as follows:
Edit the the smb.conf file to add the line :
dos filetimes = Yes
To the file share section.
But I don't understand the templating of the smb.conf. Where should I make this change to be canonical?
Thanks in anticipation,
MeJ
-
Hi,
Create a file called dos_filetimes in /etc/e-smith/templates/etc/smb.conf/ containing nothing but "dos filetimes = Yes" and do a
# /sbin/e-smith/expand-template /etc/smb.conf
Verify that the /etc/smb.conf contains the entry you wanted.
/Jesper
-
Thank you knuddi:
just what I wanted :-)
MeJ
-
> Create a file called dos_filetimes in /etc/e-
> smith/templates/etc/smb.conf/ containing nothing
> but "dos filetimes = Yes" .......
To be consistent with the way custom templates should be used, you should really add that fragment to
/etc/e-smith/templates-custom/etc/smb.conf
then do
/sbin/e-smith/expand-template /etc/smb.conf
-
Hi all,
and thanks for the help. However, this does not quite work. This does indeed insert the necessary string in the generated smb.conf file, but not in the correct section.
It needs to be applied to the ibay shares, and I don't understand the parsing of the 90ibays fragment (where I think it should be put?) in the templates/smb.conf section.
I tried adding the fragment as 91dos-filetimes but that just adds it right at the end of the smb.conf file.
Any hints? I don't really want to mess with the 90ibays fragment as I don't understand it and it's not canonical (though obviously that might work). (I really find this template system irritating albeit I know it has benfits, but a two minute job turns into three weeks of headbanging - my lack of understanding of course)
TIA,
JR
> Create a file called dos_filetimes in /etc/e-
> smith/templates/etc/smb.conf/ containing nothing
> but "dos filetimes = Yes" .......
To be consistent with the way custom templates should be used, you should really add that fragment to
/etc/e-smith/templates-custom/etc/smb.conf
then do
/sbin/e-smith/expand-template /etc/smb.conf
-
stabilys
> I don't really want to mess with the 90ibays
> fragment as I don't understand it and it's not
> canonical (though obviously that might work).
>(I really find this template system irritating
> albeit I know it has benfits...
And that IS exactly the reason the templating system is good and should be used as intended.
If you make chnages in
/etc/e-smith/templates/etc/smb.conf/fragmentname
and stuff things up, then you have potentially corrupted your original template fragments. You may or may not be able to get them back to the way they were ! Apart from that your server will be in an unusable state for a while until you resolve the problem.
If you copy the required fragments to
/etc/e-smith/templates-custom/etc/smb.conf/...
then expand the template,
and you then find that you have stuffed something up, then you simply remove the newly added fragment or changes, expand, and your server is back to its original working condition.
Note the custom templates override the settings in the standard templates. If there are no custom templates, then the standard ones will apply.
If you think the 90ibays fragment is the correct place to add your changes, then do so, but in
/etc/e-smith/templates-custom/etc/smb.conf/90ibays
Experiment away !
-
stabilys
> I don't really want to mess with the 90ibays
> fragment as I don't understand it and it's not
> canonical
And that IS exactly the reason the templating system is good and should be used as intended.
(if) you then find that you have stuffed something up, then you simply remove the newly added fragment or changes, expand, and your server is back to its original working condition.
I understand the templating system Ray, but I manage to achieve equal rollback capability in Debian just with RCS and textfiles.
stabilys
If you think the 90ibays fragment is the correct place to add your changes, then do so, but in
/etc/e-smith/templates-custom/etc/smb.conf/90ibays
Experiment away !
But that's the problem. I don't want to experiment on a production server, and I don't understand where to put the fragment I need to achieve the results I want. I don't understand the 90ibays code. All I want to do is add a simple parameter.
Any ideas, anyone?
TIA
-
stabilys
> I don't want to experiment on a production server..
That's what test servers are for !
-
Can *anyone* point me to documentation of how the smb.conf file is built by the various fragments in the templates?
Thanks!
-
stabilys
Read the code in the template fragments, that's what creates smb.conf, but I think you know that.
As your requirement is non standard, you will have to work out where your changes should go.
See
http://no.longer.valid/phpwiki/index.php/Customizing
-
Hi,
The wiki page contains a good information, but briefly, the file is built out of the fragments in templates-user, templates-custom, and templates, with user override custom, and custom override plain templates.
The "SME" way of adding your change is the following:
1. Store in the database which ibay should have dos file times.
/sbin/e-smith/db accounts setprop music DosFileTimes enabled
2.
Add the following lines inside the foreach loop, after the [$key] definition.
if (defined($properties{'DosFileTimes'}) && $properties{'DosFileTimes'} eq 'enabled') {
$result .= "dos filetimes = yes\n";
}
What this does is query the database for the ibay that's being built for the DosFileTimes key, and see if it's enabled. If it is, the line "dos filetimes = yes" is added to the $result var, which is used by the expand-template system to write the ibay entry.
HTH's
Alex
-
Thank you both for all your help - once I've figured it out exactly (and tested it) I'll post (and/or add to Wiki) exact details of the tested alteration in case anyone else needs it.
MeJ
-
Hi,
The "SME" way of adding your change is the following:
...
Add the following lines inside the foreach loop, after the [$key] definition.
if (defined($properties{'DosFileTimes'}) && $properties{'DosFileTimes'} eq 'enabled') {
$result .= "dos filetimes = yes\n";
}
Can anyone please tell me exactly where in the 90ibays template the above lines of code should be placed in SME 7.0b8 and what, if anything, should be modified for 7.0. Here is the 7.0 90ibays template:
-----------------------------------
{
# process all information-bay directories
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
foreach my $ibay ($adb->ibays)
{
$OUT .= esmith::templates::processTemplate (
{
MORE_DATA => {
ibay => $ibay,
},
TEMPLATE_PATH => "/etc/smb.conf/ibays",
OUTPUT_TYPE => 'string',
});
}
}
-----------------------------------
Thanks,
jim
-
Can anyone please tell me exactly where in the 90ibays template the above lines of code should be placed in SME 7.0b8 and what, if anything, should be modified for 7.0.
Have a look at the files in /etc/e-smith/templates/etc/smb.conf/ibays/. They're used multiple times - once for each i-bay, and interpolated into /etc/smb.conf. Otherwise they're just like any other template fragment.