There are some times when a configuration, service or system upgrade
requires a reboot to take effect. When a component requires a reboot,
it will record this fact in the file system through the file
«/var/run/reboot-required», and «ngcpcfg status» will notify the user
that a reboot has been requested.
We use the «/var/run/reboot-required» because it is already being used
in the unattended-upgrades package on Debian/Ubuntu which does something
similar.
Change-Id: I43997bfb83892f67bd57bb55ad3ec0a41a5e088d
If the latest git commit has a newer timestamp than
our latest "build" action then a "build" (or apply)
run is required, inform the user about it.
Change-Id: I83e2ff47ba54da733d368d78b6616d13d31a66d4
Provide "apply" action as separate script.
We don't care about changes related to etckeeper, but just
about outstanding commits in /etc/ngcp-config.
Change-Id: I47411f00a5085d65cacf9e24fc8a468258d57c31
This allows us to abort in 'ngcpcfg status' whenever there are
outstanding changes to pull/push from the shared storage. Using
the --no-action-failure option allows the user to continue anyway.
Change-Id: I4062d5bb627bb553b98705bb122575651b035849
`which $function` doesn't work as intended, commit
dc984aa2e7 in ngcpcfg-ha.git broke the HA features
in 'ngcpcfg status' therefore.
Change-Id: I2bb9ed9b3276e63fc6d127559df32ae229a43b33
Disabled by default as we need a time to check it carefuly.
Also we need to solve the "tilda" problem reported upstream:
https://github.com/eserte/p5-Kwalify/issues/1
Change-Id: Ia2c3d48f0ac6fc6ac9899d44f4291544373806d9
- added quiet option to disable loading output at tt2-daemon
- detect arrays and output values joined by space
Change-Id: I0b7694a366a284ca2b24ea2df55cb285b598e66d
We will use first free port instead which will be stored into
/var/run/ngcpcfg.port file while tt2-daemon is up and running.
Change-Id: I1a918f865d87863eef7d34be8abd1032282220b8
Otherwise users notice error during upgrade mr3.7->mr3.8:
> ngcpcfg commit 'snapshot during /usr/share/ngcp-upgrade-mr3.8/upgrade-2.8-to-mr3.8 - Mon Apr 13 10:29:24 CEST 2015'
> YAML Error: Couldn't open /etc/ngcp-rtpengine-daemon/interfaces.yml for input:\nNo such file or directory
> Code: YAML_LOAD_ERR_FILE_INPUT
> at /usr/share/perl5/YAML.pm line 71
> OK
> Synchronizing data from /etc/ngcp-config/constants.yml
Change-Id: I2e4b8780d2ada64854186da93b03b8817eac99bf
A random order of service restarts might not work because
a service might depend on specific monit resource(s).
Therefore restart monit before any other service(s).
Change-Id: If6eae434014f00a76fdd66aac8c82dfd69b86f1b
On a multi directory config, the services depends on git. Check
first if the git repository exists and warn about it
Change-Id: I52e335c85ecf4a330da44b3088725623f3c04531
`git diff-index --name-only HEAD` was used because it was the
only reasonable way to check for modified files back in Git 1.5.
Sadly this command can't detect files that didn't exist inside
the Git repository at all yet (so if a file was generated for the
very first time the according services script wasn't executed
necessarily).
Instead nowadays we can rely on `git status --porcelain`, which
wasn't available in Git 1.5 back then yet. Even in Debian/squeeze
there's Git version 1.7.2.5-3 available, so it's save to depend
on it. Updated Git package dependency accordingly, also switch
from transitional git-core package to the actual git one.
Tested-by: Alexander Lutay <alutay@sipwise.com>
When runnning 'ngcpcfg build' (which is also executed when
running 'ngcpcfg apply') we waste quite some time with loading
the same YAML configuration files and merging them again and
again.
In a 'ngcpcfg build' run we don't have to re-load and merge those
configuration files again and again (since they won't modify
during a single run), instead just load+merge them *once* and
re-use the result on all the following execution steps in the
same run.
Original:
| # time ngcpcfg apply >/dev/null
| ngcpcfg apply > /dev/null 149.01s user 9.49s system 96% cpu 2:43.57 total
Reworked optimized runs:
| # time ngcpcfg apply >/dev/null
| ngcpcfg apply > /dev/null 81.25s user 8.62s system 95% cpu 1:34.17 total
For debugging purposes you can execute 'ngcpcfg build' under
NO_REUSE=1 to not use this feature, executing it under 'DEBUG=1'
won't remove the so called reuse file which stores the merged
configuration data.
Thanks: Alexander Lutay for the initial patch and idea
Files in configuration directory EXTRA_CONFIG_DIR (being
/etc/ngcp-config/config.d/ by default) with the suffix yml (so
e.g. a file named pbx.yml can be shipped by an external Debian
package) are additionally taken into consideration as main
configuration files.
Those extra configuration file(s) have higher precedence than
the other yml configuration files (config.yml, network.yml,...),
*except* for constants.yml which has the power to override all
settings, including the ones from files inside EXTRA_CONFIG_DIR.
Closes: sipwise-#3059