IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Some of these just aim to load the generic script.options file while
others target more specific files.
For NFS configuration, always use 60.nfs.options - even for 06.nfs.
This could be carefully documented but will change a lot before
release so there is no need.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Just document that NAT gateway and LVS are not compatible with this
option. Update the documentation to make it clear that this is a
10.interface option.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
If CTDB_DBDIR_PERSISTENT is not set then set the default relative to
CTDB_VARDIR. The persistent database directory is not (necessarily)
relative to the volatile one.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This was previously used by the loadconfig() function.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This warning (apparently new in shellcheck 0.4.7) only applies to
double-quoted strings. Change affected constant strings to use
single-quotes. In the one example that contains a variable expansion
escape the backslash as recommended.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359
There is no serverid database anymore.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144
Using CTDB_SET_TunableVariables in the main configuration file is no
longer supported.
The only subtlety is an unexpected order change in one of the unit
test results. This is because the old implementation implicitly
sorted the tunable variables via the set command.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
loadconfig() currently tries to load the CTDB configuration and also
any system configuration relevant to the current (event) script.
Instead add a new function load_system_config() to load the
distribution-specific system configuration for a component. Call this
directly in the rare scripts that need the system configuration.
Also call load_system_config when loading the CTDB configuration to
pull in anything from the CTDB system configuration. This is partly
for backward compatibility but also to get options that can be used
anywhere.
loadconfig() no longer takes an argument. It simply loads the CTDB
configuration.
Drop support for falling back to /etc/ctdb/sysconfig/ctdb (or
similar). Surely there's nobody who uses that!
Also, drop the indirection where loadconfig() calls _loadconfig().
This was used years ago as a test hook and is no longer required.
Inexplicably, this change introduces a new shellcheck test failure, so
silence this.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This seems never to have caught on so reduce complexity.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
The interface must always be specified in the public addresses file.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This option adds a lot of unnecessary complexity to scripts.
Configuration should go in $CTDB_BASE, either directly or via a
symlink, so simplify by using the default location.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This was added for a vendor who decided not to use it. It is almost
certainly unused by anyone. If anyone really needs it then it is in
the git history.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Scripts that use these counters must call ctdb_setup_state_dir().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Scripts that use these functions must call ctdb_setup_state_dir().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Replace all uses of ctdb_setup_service_state_dir() by
ctdb_setup_state_dir().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This makes it consistent with the rest of the script code.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This is an unconditional reconfiguration so skip the unnecessary
logic.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070
This avoids running event script copies left by a package manager.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This was out of date due to the removal of service_check_reconfigure()
and similar.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144
Failures in startup/shutdown/releaseip/takeip are currently
incorrectly ignored.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12837
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Commit 0ca00267cd removed explicit
continuations in strings for awk programs. In one case this causes a
disconnect between condition and action, where an implicit
continuation does not work. This results in duplicate lines in the
rt_tables file.
Move the opening brace for the action to make the implicit
continuation work as expected.
An alternative would be to revert the removal of the explicit
continuations and add shellcheck tags. However, that doesn't mean
that an author of future code will necessarily use explicit
continuations, so the same mistake might still be make in the future.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516
Reported-by: Barry Evans <bevans@pixitmedia.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This changed to "ctdb gratarp" some time ago but the scripts were
never updated.
Fix the documentation for the ctdb tool too.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12512
Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This is only used in 1 place, so just inline the check.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
They contain too much unnecessary complexity, some of which was used
to support CTDB_SERVICE_AUTOSTARTSTOP.
Also removed unused functions for service management.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This has bit-rotted, at least for NFS. It can be fixed but it is
better to remove it because it adds a lot of unnecessary complexity.
Variable event_name becomes unused so remove it. Also remove
associated tests.
To continue to manage/unmanage services while CTDB is running:
* Start service by hand and then flag it as managed
* Mark service as unmanaged and shut it down by hand
In some cases CTDB does something fancy - e.g. start Samba under
"nice", so care is needed. One technique is to disable the
eventscript, mark as managed, run the startup event by hand and then
re-enable the eventscript.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This will help get rid of implicit ctdb_service_check_reconfigure.
We still need to keep "reconfigure" event in 13.per_ip_routing, so that
the per ip routing can be refreshed if the configuration has changed.
The correct fix for this is to add caching of configuration and checking
of configuration changes in "ipreallocated" event.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
If any processes remain then they may be stuck in D state and this
might tell us why.
Update tests: tweak pidof stub, add support for smbd stack traces and
add some new tests for the shutdown event.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Oct 10 12:54:24 CEST 2016 on sn-devel-144
SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2094: Make sure not to read and write the same file in the same pipeline.
The semantics here are unclear, so use a separate flock file in each
case for clarity.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2039: In POSIX sh, echo flags are not supported.
echo -n is well supported but the changes are simple.
Improve some logic, replace some instances with printf. Who knew
printf was in POSIX?
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2039: In POSIX sh, 'type' is not supported.
type is commonly supported and is more portable than which(1).
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC1004: You don't break lines with \ in single quotes, it results in
literal backslash-linefeed.
These don't hurt, since awk can cope with the continuations. However,
they don't add anything.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2154: VAR is referenced but not assigned.
Change ctdb_setup_service_state_dir(), ctdb_get_pnn() and
ctdb_get_ip_address() to print the value so it can be assigned to a
variable. The performance gain from avoiding the sub-shells when
calling these functions is close to zero.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.
Add some quoting where it makes sense. Use shellcheck directives for
false-positives.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2034: VAR appears unused. Verify it or export it.
Drop some variables that are unnecessarily used. Use shellcheck
directive for false-positives.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2030: Modification of VAR is local (to subshell caused by (..) group).
SC2031: VAR was modified in a subshell. That change might be lost.
Fix a related, incorrect comment.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This makes the logic more obvious.
Fix the (probably) accidental fall-through to the regular monitor
failure.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Re-indent case labels as per new script style
Other indentation can be tweaked later as code changes, but the
labels are an obvious bulk change.
* Minor whitespace fixes
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>