Koozali.org: home of the SME Server

When server restart I lose configurations

When server restart I lose configurations
« on: March 10, 2011, 01:11:47 PM »
Hey!

Whenever I restart the server, my /etc/ntp.conf file gets the way it comes in a fresh installation.

The file comes with this header:
Quote
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------


I went to the http://www.contribs.org/development/ link, but I found it a bit confusing.

I'm sure there is a simple way to overcome this issue, I'm just not an experienced SME system manager.

Please help.

With my best regards,
sebastiaopburnay

Offline johnp

  • *****
  • 312
  • +0/-0
Re: When server restart I lose configurations
« Reply #1 on: March 10, 2011, 01:20:08 PM »
What are you trying to do? If you are editing this file directly, that is not the way to do it correctly. You need to use custom templates.

Re: When server restart I lose configurations
« Reply #2 on: March 10, 2011, 01:53:30 PM »
Well, would like for the ntpd to always use a user-defined ntp.conf (defined by myself).


Re: When server restart I lose configurations
« Reply #3 on: March 10, 2011, 01:54:28 PM »
by the way, I would like to do the same to the IP configuration, as well as the routing table and the /etc/resolve.conf file

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: When server restart I lose configurations
« Reply #4 on: March 10, 2011, 02:18:37 PM »
Sebastiao, please tell us what you are trying to achieve and why..

thank you

Re: When server restart I lose configurations
« Reply #5 on: March 10, 2011, 03:17:39 PM »
Sure,

The ideia is to insert a server in a cluster with the only purpose of supplying ntp service.

I'm sure, some people would suggest a less complete linux distribution, but since I wont be the one administrating the machine, I would like to have something like the sme server server-manager page and also the sme7admin app.

When I configure the ntp.conf file, the service works as I want it to, but when system reboots, those configuration changes are lost and the O.S. re-loads those sample configuration files.

I would like for those changes not to be lost during system reboots.

The same configuration issue applies to the ip-configuration (ifconfig), the routing table (route -n) and the nameservers (/etc/resolv.conf file).

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: When server restart I lose configurations
« Reply #6 on: March 10, 2011, 03:42:34 PM »
The ideia is to insert a server in a cluster with the only purpose of supplying ntp service.

When I configure the ntp.conf file, the service works as I want it to, but when system reboots, those configuration changes are lost and the O.S. re-loads those sample configuration files.

SME can act as a ntp server without any customization.. so why do you need a customization? and, of course, what kind of customization?

Quote
I would like for those changes not to be lost during system reboots.

you need some custom fragments/template

Quote
The same configuration issue applies to the ip-configuration (ifconfig), the routing table (route -n) and the nameservers (/etc/resolv.conf file).

same question: what do you need? can you post an example?

Re: When server restart I lose configurations
« Reply #7 on: March 10, 2011, 04:08:03 PM »
Well, about the NTP, the VM is still in a «sandbox» network and soon it will be migrated to a cluster, with no internet access, so it will have to be a standalone NTP server to keep the cluster synchronyzed.

Now I use as external source, the government NTP servers which give legal time for my country and you can see bellow the ntp.conf file as I want it to be:
Code: [Select]
# [PT] Se nao indicar ficheiro de log, ele loga no syslog
# [EN] Without a directive for a log file it will use syslog
logfile /var/log/ntpd
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# [PT] Lista de servidores - Inclui OAL :: Hora legal em Portugal (no futuro sera standalone)
# [EN] Servers List - Includes OAL:: Legal Time for Portugal (futurely it will be standalone)
#
server ntp02.oal.ul.pt
server ntp04.oal.ul.pt

# [PT] Se todos falharem, o SME assume-se ntp principal, no futuro sera assim
# [EN] If they all fail, SME assumes main NTP server place, it will be like that in the future
#
server 127.127.1.0
fudge 127.127.1.0 stratum 13

# [PT] Todos podem aceder, mas não podem configurar
# [EN] Everyone can access, but not configure it
#
restrict default kod notrap nomodify nopeer noquery

# [PT] Utilizador local tem acesso directo
# [EN] Local user has direct access
#
restrict 127.0.0.1 nomodify

# [PT] Broadcast para rede local 192.168.1.0/24
# [EN] Broadcast for Local Network 192.168.1.0/24
#
broadcast 192.168.1.255

# [PT] Desabilita a autenticação para rede local
# [EN] Disables authentication for Local Network
#
disable auth
broadcastclient

About the other configurations, for now I want them like this:
Quote
[root@ntp-server ~]# route -n
Kernel IP routing table
Destination     Gateway           Genmask         Flags    Metric   Ref    Use Iface
192.168.1.0     0.0.0.0            255.255.255.0   U        0           0        0 eth0
1.0.0.0            0.0.0.0            255.0.0.0         U        0           0        0 bond0
0.0.0.0            192.168.1.254    0.0.0.0           UG       0          0        0 eth0
And also the /etc/resolv.conf file:
Quote
domain prologica.lab
search prologica.lab
nameserver 192.168.1.155
nameserver 192.168.1.154

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: When server restart I lose configurations
« Reply #8 on: March 10, 2011, 07:05:55 PM »
Please take a look at the Developers Guide in the wiki. It has a detailed section on how the template system and the internal configuration database works. It should give you all the information needed to reach your targets, but for some things you do not even need alterations or additions to templates. Simply setting up the configuration properties properly will do for (part of) your problems.

If you set the domain of your server to prologica.lab you already have that properly on your /etc/resolv.conf file. AFAICT the search option is not really needed for SME Server as it is perfectly capable of resolving (short) hostnames properly when the domain is set to the correct value.

BTW is there a specific reason to not use SME Server as the default nameserver? It is more than capable of doing so. I think it is very much overkill to only install SME Server for a timeserver.
« Last Edit: March 10, 2011, 07:09:42 PM by cactus »
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)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: When server restart I lose configurations
« Reply #9 on: March 11, 2011, 05:13:51 PM »
Please also go to the Howtos page & read the Templates Tutorial
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.