Koozali.org formerly Contribs.org

Managing resolv.conf and other template tasks

IceDizzy

Managing resolv.conf and other template tasks
« on: March 28, 2006, 06:23:36 PM »
Yes i've red the manual 4 developers and yes i didn't got it i know that but...
Simple question:
You want to update i.e resolv.conf with:

search mydomain1.se mydomain2.mydomain1.se
nameserver 10.32.9.28
nameserver 10.101.8.24

How?
Of course you can just put it there but the solution would not last.
Ok andling of templates are the solution but i dont got it.
Plz a step by step instruction then i can put the knowledge into handling of other templates.

Regards:
/Ice

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: Managing resolv.conf and other template tasks
« Reply #1 on: March 28, 2006, 06:54:40 PM »
Quote from: "IceDizzy"
Yes i've red the manual 4 developers and yes i didn't got it i know that but...
Simple question:
You want to update i.e resolv.conf with:

search mydomain1.se mydomain2.mydomain1.se
nameserver 10.32.9.28
nameserver 10.101.8.24

How?
Of course you can just put it there but the solution would not last.
Ok andling of templates are the solution but i dont got it.
Plz a step by step instruction then i can put the knowledge into handling of other templates.

Regards:
/Ice


To make a copy of the templates in the templates-custom directory (the place to make your modifications so they last)
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/resolv.conf/
cp -p /etc/e-smith/templates/etc/resolv.conf/* /etc/e-smith/templates-custom/etc/resolv.conf/

The template files take al ot of theire settings from the interanl configuration database, so you might be better of looking for the way to enter them in the database, however it is possible to hardcode them in one of the files just edit the files to add/alter your settings.
After that expand the resolv.conf template:
Code: [Select]
expand-template /etc/resolv.conf
To see if the cahnges are in the configuration file view it:
Code: [Select]
cat /etc/resolv.conf
If everything seems ok then reboot the machine to reflect  the changes (as I don't know exactly which service to restart)
Code: [Select]
signal-event reboot
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

IceDizzy

Thanks for your reply
« Reply #2 on: March 28, 2006, 07:57:50 PM »
I figured thats how but how to hard code?
Plain text file?
There are just functions in the files, example of hardcode i.e my example above would be nice.
The search variable for search path should it be a new file?
today there are:
10domain  25nameserver  30timeout

Maybe it is better to access the db.
Name of the base user and pwd wich one?

Still curious.
/Ice

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: Thanks for your reply
« Reply #3 on: March 28, 2006, 11:08:28 PM »
Quote from: "IceDizzy"
I figured thats how but how to hard code?
Plain text file?
There are just functions in the files, example of hardcode i.e my example above would be nice.
The search variable for search path should it be a new file?
today there are:
10domain  25nameserver  30timeout

Maybe it is better to access the db.
Name of the base user and pwd wich one?

Still curious.
/Ice


Hard coding is just entering the text as is outside the { } marks...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)