Enable required event scripts to manage services.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
If the "startup" event fails then CTDB will retry it until it
succeeds. There is no limit on the number of retries.
- Example: 50.samba uses this event to start the Samba daemon if
- CTDB_MANAGES_SAMBA=yes.
+ Example: 50.samba uses this event to start the Samba daemon.
shutdown
event and use it to stop the service.
Example: 50.samba uses this event to shut down the Samba
- daemon if CTDB_MANAGES_SAMBA=yes.
+ daemon.
monitor
# shellcheck disable=SC2154
nfs_callout_init "$script_state_dir"
-[ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
-
case "$1" in
takeip)
nfs_callout_pre "$@"
load_script_options
-[ "$CTDB_MANAGES_CLAMD" = "yes" ] || exit 0
-
case "$1" in
startup)
service "$service_name" stop > /dev/null 2>&1
ctdb_setup_state_dir "service" "$service_name"
-[ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
-
case "$1" in
startup)
service "$service_name" stop > /dev/null 2>&1
killall -q -9 $service_name || true
}
-[ "$CTDB_MANAGES_HTTPD" = "yes" ] || exit 0
-
case "$1" in
startup)
service_start
###########################
-[ "$CTDB_MANAGES_WINBIND" = "yes" ] || exit 0
-
-###########################
-
case "$1" in
startup)
service_start
###########################
-[ "$CTDB_MANAGES_SAMBA" = "yes" ] || exit 0
-
-###########################
-
case "$1" in
startup)
service_start
# shellcheck disable=SC2154
nfs_callout_init "$script_state_dir"
-[ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
-
case "$1" in
startup)
nfs_callout "$@" || exit $?
load_script_options
-[ "$CTDB_MANAGES_ISCSI" = "yes" ] || exit 0
-
[ -z "$CTDB_START_ISCSI_SCRIPTS" ] && {
echo "No iscsi start script directory found"
exit 0
-# For now, use script.options to demonstrate these options. The
-# CTDB_MANAGES_* variables will go away soon. See other *.options
-# examples for more specific examples.
+# For now, use script.options to demonstrate these options. See
+# *.options examples for more specific examples.
#
# Samba configuration
#
# 50.samba.options
-CTDB_MANAGES_SAMBA=yes
# CTDB_SAMBA_SKIP_SHARE_CHECK=yes
-# 49.winbind.options
-CTDB_MANAGES_WINBIND=yes
-
#
# NFS configuration
#
# 60.nfs.options
-CTDB_MANAGES_NFS=yes
CTDB_RPCINFO_LOCALHOST="127.0.0.1"
<variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_CLAMD=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage ClamAV?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>
CTDB_CLAMD_SOCKET=<parameter>FILENAME</parameter>
</refsect2>
- <refsect2>
- <title>40.vsftpd</title>
-
- <para>
- Provides CTDB's vsftpd FTP service management.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>CTDB_MANAGES_VSFTPD=yes|no</term>
- <listitem>
- <para>
- Should CTDB manage the vsftpd FTP server?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect2>
-
- <refsect2>
- <title>41.httpd</title>
-
- <para>
- Provides CTDB's Apache web service management.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_HTTPD=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage the Apache web server?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect2>
-
<refsect2>
<title>49.winbind</title>
<variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_WINBIND=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage Winbind?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>
CTDB_SERVICE_WINBIND=<parameter>SERVICE</parameter>
<variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_SAMBA=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage Samba?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>
CTDB_SAMBA_CHECK_PORTS=<parameter>PORT-LIST</parameter>
<variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_NFS=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage NFS?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>
CTDB_NFS_CALLOUT=<parameter>COMMAND</parameter>
<variablelist>
- <varlistentry>
- <term>
- CTDB_MANAGES_ISCSI=yes|no
- </term>
- <listitem>
- <para>
- Should CTDB manage iSCSI tgtd?
- </para>
- <para>
- Default is no.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>
CTDB_START_ISCSI_SCRIPTS=<parameter>DIRECTORY</parameter>