.gear/rules | 2 + .gear/tags/list | 1 + .gear/upstream/filter-tag | 1 + .gear/upstream/remotes | 3 + .gear/upstream/transform-tag | 1 + lib/common/cmdline.c | 2 +- pacemaker.init | 99 ++++++++++ pacemaker.spec | 460 +++++++++++++++++++++++++++++++++++++++++++ pacemaker_remote.init | 93 +++++++++ tools/crm_report.in | 2 +- 10 files changed, 662 insertions(+), 2 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 000000000..96e2b255c --- /dev/null +++ b/.gear/rules @@ -0,0 +1,2 @@ +tar: Pacemaker-@version@:. +diff: Pacemaker-@version@:. . name=@name@-@version@-alt.patch diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 000000000..9adf7a5dc --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +6fdc9deea294bbad629b003c6ae036aaed8e3ee0 Pacemaker-2.1.6 diff --git a/.gear/upstream/filter-tag b/.gear/upstream/filter-tag new file mode 100755 index 000000000..25b391ea5 --- /dev/null +++ b/.gear/upstream/filter-tag @@ -0,0 +1 @@ +grep '^Pacemaker-[0-9.]\+$' diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes new file mode 100644 index 000000000..b2c42ee8b --- /dev/null +++ b/.gear/upstream/remotes @@ -0,0 +1,3 @@ +[remote "upstream"] + url = https://github.com/ClusterLabs/pacemaker.git + fetch = +refs/heads/*:refs/remotes/upstream/* diff --git a/.gear/upstream/transform-tag b/.gear/upstream/transform-tag new file mode 100755 index 000000000..8c8eff46f --- /dev/null +++ b/.gear/upstream/transform-tag @@ -0,0 +1 @@ +sed 's/^Pacemaker-//' diff --git a/lib/common/cmdline.c b/lib/common/cmdline.c index 08c43f79a..1f58b14c5 100644 --- a/lib/common/cmdline.c +++ b/lib/common/cmdline.c @@ -268,7 +268,7 @@ pcmk__cmdline_preproc(char *const *argv, const char *special) { /* This is a short argument, or perhaps several. Iterate over it * and explode them out into individual arguments. */ - if (g_str_has_prefix(argv[i], "-") && !g_str_has_prefix(argv[i], "--")) { + if (g_str_has_prefix(argv[i], "-") && !g_str_has_prefix(argv[i], "--") && strlen(argv[i]) <= 2 ) { /* Skip over leading dash */ const char *ch = argv[i]+1; diff --git a/pacemaker.init b/pacemaker.init new file mode 100755 index 000000000..0bc3d4b8d --- /dev/null +++ b/pacemaker.init @@ -0,0 +1,99 @@ +#!/bin/bash + +# Authors: +# Andrew Beekhof +# Fabio M. Di Nitto +# +# License: Revised BSD + +# chkconfig: - 99 01 +# description: Pacemaker Cluster Manager +# processname: pacemakerd +# +### BEGIN INIT INFO +# Provides: pacemaker +# Required-Start: $network corosync +# Should-Start: $syslog +# Required-Stop: $network corosync +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Starts and stops Pacemaker Cluster Manager. +# Description: Starts and stops Pacemaker Cluster Manager. +### END INIT INFO + +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + +# Source function library. +. /etc/init.d/functions + +desc="Pacemaker Cluster Manager" +prog="pacemakerd" + +SourceIfNotEmpty /etc/sysconfig/pacemaker +LOCKFILE="/var/lock/subsys/$prog" +PIDFILE="/var/run/pacemaker.pid" +RETVAL=0 + +# Unless specified otherwise, assume cman is in use if cluster.conf exists +if [ x = "x$PCMK_STACK" -a -f /etc/corosync/corosync.conf ]; then + PCMK_STACK=corosync +fi + +start() +{ + start_daemon --make-pidfile --background --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $prog + RETVAL=$? + return $RETVAL +} + +stop() +{ + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $prog + RETVAL=$? + return $RETVAL +} + +restart() +{ + stop + start +} + + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + condrestart) + if [ -e "$LOCKFILE" ]; then + restart + fi + ;; + condreload) + if [ -e "$LOCKFILE" ]; then + reload + fi + ;; + condstop) + if [ -e "$LOCKFILE" ]; then + stop + fi + ;; + status) + status --expect-user root -- $prog + RETVAL=$? + ;; + *) + msg_usage "${0##*/} {start|stop|restart|reload|condrestart|condstop|condreload|status}" + RETVAL=1 +esac + +exit $RETVAL diff --git a/pacemaker.spec b/pacemaker.spec new file mode 100644 index 000000000..85a71f6b3 --- /dev/null +++ b/pacemaker.spec @@ -0,0 +1,460 @@ +%define _unpackaged_files_terminate_build 1 +%define _rundir /run +%define gname haclient +%define uname hacluster +%define _libexecdir /usr/libexec + +%add_findreq_skiplist */ocf/resource.d/.isolation/* +%add_findreq_skiplist */ocf/resource.d/pacemaker/* +%filter_from_requires /^\(pdsh\|putty\)$/d + +%def_disable doc + +Name: pacemaker +Summary: Scalable High-Availability cluster resource manager +Version: 2.1.6 +Release: alt1 +License: GPLv2+ and LGPLv2+ +Url: http://www.clusterlabs.org +# VCS: https://github.com/ClusterLabs/pacemaker.git +Group: System/Servers +Source: %name-%version.tar +Patch: %name-%version-alt.patch + +Provides: pcmk-cluster-manager +Requires: corosync +Requires: resource-agents +Requires: lib%name = %version-%release +Requires(pre): %name-cli = %version-%release + +BuildRequires(pre): rpm-build-python3 +BuildRequires: /proc +BuildRequires: glib2-devel libxml2-devel libxslt-devel libuuid-devel systemd-devel libdbus-devel perl(Pod/Text.pm) +BuildRequires: python3-devel gcc-c++ bzlib-devel libpam-devel +BuildRequires: libqb-devel > 0.11.0 libgnutls-devel libltdl-devel libgio-devel +BuildRequires: libncurses-devel libssl-devel libselinux-devel docbook-style-xsl +BuildRequires: help2man xsltproc +BuildRequires: libesmtp-devel libsensors3-devel libnet-snmp-devel libopenipmi-devel libservicelog-devel +BuildRequires: libcorosync-devel +%{?_enable_doc:BuildRequires: publican inkscape asciidoc} + +%description +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +It supports "n-node" clusters with significant capabilities for +managing resources and dependencies. + +It will run scripts at initialization, when machines go up or down, +when related resources fail and can be configured to periodically check +resource health. + +Available rpmbuild rebuild options: + --with(out) : heartbeat cman corosync doc publican snmp esmtp pre_release + +%package cli +License: GPLv2+ and LGPLv2+ +Summary: Command line tools for controlling Pacemaker clusters +Group: System/Servers +Requires: perl-DateTime-Format-DateParse +Requires: procps-ng +Requires: psmisc + +%description cli +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +The %name-cli package contains command line tools that can be used +to query and control the cluster from machines that may, or may not, +be part of the cluster. + +%package -n lib%name +License: GPLv2+ and LGPLv2+ +Summary: Core Pacemaker libraries +Group: System/Servers +Requires: %name-schemas = %version-%release + +%description -n lib%name +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +The lib%name package contains shared libraries needed for cluster +nodes and those just running the CLI tools. + +%package remote +License: GPLv2+ and LGPLv2+ +Summary: Pacemaker remote daemon for non-cluster nodes +Group: System/Servers + +Provides: pcmk-cluster-manager +Requires: resource-agents +Requires: lib%name = %version-%release +Requires: %name-cli = %version-%release + +%description remote +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +The %name-remote package contains the Pacemaker Remote daemon +which is capable of extending pacemaker functionality to remote +nodes not running the full corosync/cluster stack. + +%package -n lib%name-devel +License: GPLv2+ and LGPLv2+ +Summary: Pacemaker development package +Group: Development/C +Requires: lib%name = %version-%release +Requires: libqb-devel libuuid-devel +Requires: libxml2-devel libxslt-devel bzlib-devel glib2-devel +Requires: libcorosync-devel + +%description -n lib%name-devel +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +The lib%name-devel package contains headers and shared libraries +for developing tools for Pacemaker. + +%package cts +License: GPLv2+ and LGPLv2+ +Summary: Test framework for cluster-related technologies like Pacemaker +Group: System/Servers +Requires: resource-agents +Requires: procps-ng +Requires: %name-cli = %version-%release +Requires: psmisc +BuildArch: noarch + +%description cts +Test framework for cluster-related technologies like Pacemaker + +%package doc +License: GPLv2+ and LGPLv2+ +Summary: Documentation for Pacemaker +Group: System/Servers +BuildArch: noarch + +%description doc +Documentation for Pacemaker. + +Pacemaker is an advanced, scalable High-Availability cluster resource +manager for Linux-HA (Heartbeat) and/or Corosync. + +%package schemas +License: GPLv2+ +Summary: Schemas and upgrade stylesheets for Pacemaker +Group: System/Servers +BuildArch: noarch + +%description schemas +Schemas and upgrade stylesheets for Pacemaker + +Pacemaker is an advanced, scalable High-Availability cluster resource +manager. + +%prep +%setup +%patch -p1 + +%build +%autoreconf +%configure \ + PYTHON=/usr/bin/python3 \ + --disable-fatal-warnings \ + --disable-static \ + --with-profiling \ + --with-gcov \ + --with-acl \ + --with-ais \ + --with-nls \ + --with-sbd-sync-default="true" \ + --with-cibsecrets \ + --with-corosync \ + --with-cs-quorum \ + --with-stonithd \ + --enable-thread-safe \ + --with-initdir=%_initdir \ + --enable-systemd \ + --disable-upstart \ + --with-systemdsystemunitdir=%_unitdir \ + --with-runstatedir=%_rundir \ + --localstatedir=%_var \ + --with-nagios-plugin-dir=%_prefix/lib/nagios/plugins \ + --with-daemon-user=%uname \ + --with-daemon-group=%gname \ + --with-version=%version-%release + +subst 's|/usr/bin/help2man|/usr/bin/help2man --no-discard-stderr|g' tools/Makefile + +%make_build +# Hack to fix undefined symbol get_object_root +cd lib/pengine +make clean +subst 's|^libpe_status_la_LIBADD = |libpe_status_la_LIBADD = $(top_builddir)/lib/cib/libcib.la |' Makefile +%make_build LDFLAGS=-L../cib/.libs + +%install +%makeinstall_std + +mkdir -p %buildroot%_var/lib/pacemaker/cores +install -D -m 644 etc/sysconfig/pacemaker %buildroot%_sysconfdir/sysconfig/pacemaker +install -D -m 755 pacemaker.init %buildroot%_initdir/pacemaker +install -D -m 755 pacemaker_remote.init %buildroot%_initdir/pacemaker_remote + +# Copy configuration for pacemaker_remote and use it in init script +install -D -m 644 etc/sysconfig/pacemaker %buildroot%_sysconfdir/sysconfig/pacemaker_remote +subst 's|/etc/sysconfig/pacemaker|/etc/sysconfig/pacemaker_remote|' %buildroot%_initdir/pacemaker_remote +install -D -m 755 pacemaker_remote.init %buildroot%_initdir/pacemaker_remote + +# These are not actually scripts +find %buildroot -name '*.xml' -type f -print0 | xargs -0 chmod a-x +find %buildroot -name '*.xsl' -type f -print0 | xargs -0 chmod a-x +find %buildroot -name '*.rng' -type f -print0 | xargs -0 chmod a-x + +# Don't package static libs +find %buildroot -name '*.a' -type f -print0 | xargs -0 rm -f +find %buildroot -name '*.la' -type f -print0 | xargs -0 rm -f + +# Do not package this either +rm -rf %buildroot%_datadir/pacemaker/tests/cts + +GCOV_BASE=%buildroot/%_var/lib/pacemaker/gcov +mkdir -p $GCOV_BASE +find . -name '*.gcno' -type f | while read F ; do + D=`dirname $F` + mkdir -p ${GCOV_BASE}/$D + cp $F ${GCOV_BASE}/$D +done + + +%pre cli +groupadd -f -r %gname ||: +getent passwd %uname >/dev/null || useradd -r -g %gname -s /sbin/nologin -c "cluster user" %uname ||: + +%post cli +%post_service crm_mon + +%preun cli +%preun_service crm_mon + +%post +%post_service %name + +%preun +%preun_service %name + +%post -n %name-remote +%post_service pacemaker_remote + +%preun -n %name-remote +%preun_service pacemaker_remote + +%files +%doc COPYING ChangeLog README.markdown +%doc %_datadir/pacemaker/alerts +%exclude %_libexecdir/pacemaker/cts-log-watcher +%exclude %_libexecdir/pacemaker/cts-support +%exclude %_sbindir/pacemaker-remoted +%exclude %_sbindir/pacemaker_remoted +%config(noreplace) %_sysconfdir/sysconfig/pacemaker +%_sbindir/pacemakerd +%_initdir/pacemaker +%_unitdir/pacemaker.service +%_logrotatedir/%name +%_libexecdir/pacemaker/* +%_sbindir/fence_watchdog +%_man7dir/*.7* +%_man8dir/pacemakerd.* +%dir %attr (750, %uname, %gname) %_var/lib/pacemaker/cib +%dir %attr (750, %uname, %gname) %_var/lib/pacemaker/pengine +/usr/lib/ocf/resource.d/pacemaker/controld +/usr/lib/ocf/resource.d/pacemaker/remote + +%files cli +%config(noreplace) %_sysconfdir/sysconfig/crm_mon +%_sbindir/attrd_updater +%_sbindir/cibadmin +%_sbindir/cibsecret +%_sbindir/crm_attribute +%_sbindir/crm_diff +%_sbindir/crm_error +%_sbindir/crm_failcount +%_sbindir/crm_master +%_sbindir/crm_mon +%_unitdir/crm_mon.service +%_sbindir/crm_node +%_sbindir/crm_standby +%_sbindir/crmadmin +%_sbindir/iso8601 +%_sbindir/crm_shadow +%_sbindir/crm_simulate +%_sbindir/crm_report +%_sbindir/crm_resource +%_sbindir/crm_rule +%_sbindir/crm_ticket +%_sbindir/crm_verify +%_sbindir/stonith_admin +%_man8dir/*.8* +%exclude %_man8dir/pacemakerd.* +%exclude %_man8dir/pacemaker-remoted.* + +%_datadir/pacemaker/report.collector +%_datadir/pacemaker/report.common +%_datadir/snmp/mibs/PCMK-MIB.txt + +%dir /usr/lib/ocf +%dir /usr/lib/ocf/resource.d +/usr/lib/ocf/resource.d/pacemaker +%exclude /usr/lib/ocf/resource.d/pacemaker/controld +%exclude /usr/lib/ocf/resource.d/pacemaker/remote + +%dir %attr (750, %uname, %gname) %_var/lib/pacemaker +%dir %attr (750, %uname, %gname) %_var/lib/pacemaker/cores +%dir %attr (750, %uname, %gname) %_var/lib/pacemaker/blackbox +%dir %attr (770, %uname, %gname) %_var/log/pacemaker +%dir %attr (770, %uname, %gname) %_var/log/pacemaker/bundles + +%files -n lib%name +%_libdir/*.so.* + +%files remote +%config(noreplace) %_sysconfdir/sysconfig/pacemaker_remote +%_initdir/pacemaker_remote +%_unitdir/pacemaker_remote.service +%_sbindir/pacemaker-remoted +%_sbindir/pacemaker_remoted +%_man8dir/pacemaker-remoted.* + +%files doc +%doc %_docdir/%name + +%files cts +%python3_sitelibdir_noarch/* +%_datadir/pacemaker/tests +%_libexecdir/pacemaker/cts-log-watcher +%_libexecdir/pacemaker/cts-support + +%files -n lib%name-devel +%_includedir/pacemaker +%_libdir/*.so +%_pkgconfigdir/*.pc +%_datadir/pkgconfig/*.pc + +%files schemas +%dir %_datadir/pacemaker +%_datadir/pacemaker/*.rng +%_datadir/pacemaker/*.xsl +%_datadir/pacemaker/api +%_datadir/pacemaker/base + +%changelog +* Thu May 25 2023 Andrey Cherepanov 2.1.6-alt1 +- New version. + +* Fri Dec 09 2022 Andrey Cherepanov 2.1.5-alt1 +- New version. + +* Tue Jul 12 2022 Andrey Cherepanov 2.1.4-alt2 +- Removed extra requirements to pdsh and putty (ALT #43211). + +* Sun Jul 10 2022 Andrey Cherepanov 2.1.4-alt1 +- New version. + +* Sun Jun 12 2022 Andrey Cherepanov 2.1.3-alt1 +- New version. + +* Sat Nov 27 2021 Andrey Cherepanov 2.1.2-alt1 +- New version. + +* Mon Sep 13 2021 Andrey Cherepanov 2.1.1-alt1 +- New version. + +* Wed Aug 25 2021 Pavel Vasenkov 2.1.0-alt2 +- Fixes command line arguments parsing (#40643) + +* Thu Jun 24 2021 Andrey Cherepanov 2.1.0-alt1 +- New version. +- Security fix CVE-2020-25654 in 2.0.5. + +* Fri Jan 08 2021 Andrey Cherepanov 2.0.5-alt1 +- New version. + +* Sat Apr 04 2020 Alexey Shabalin 2.0.3-alt2 +- define %%_libexecdir as /usr/libexec +- move attrd_updater, crm_attribute, crm_master to pacemaker-cli + +* Wed Dec 18 2019 Alexey Shabalin 2.0.3-alt1 +- New version. +- disable build doc (error build publican on i586) + +* Sun Jun 16 2019 Alexey Shabalin 2.0.2-alt1 +- New version. +- Security fixes CVE-2018-16878, CVE-2019-3885. + +* Wed Mar 06 2019 Alexey Shabalin 2.0.1-alt1 +- New version. +- build with python3 +- move schemas to sepatated package +- security fix CVE-2018-16877 + +* Thu Oct 04 2018 Andrey Cherepanov 2.0.0-alt1 +- New version. + +* Tue Mar 13 2018 Andrey Cherepanov 1.1.18-alt1 +- New version. + +* Tue Oct 03 2017 Andrey Cherepanov 1.1.17-alt2 +- Build without cluster-glue (ALT #33944) + +* Thu Jul 13 2017 Andrey Cherepanov 1.1.17-alt1 +- New version + +* Thu Jun 29 2017 Denis Medvedev 1.1.16-alt3 +- Fix initscript,(ALT #33598). + +* Wed Apr 12 2017 Valery Inozemtsev 1.1.16-alt2 +- enabled stonithd + +* Sat Dec 24 2016 Andrey Cherepanov 1.1.16-alt1 +- New version +- Security fix CVE-2016-7035 + +* Fri Sep 23 2016 Alexey Shabalin 1.1.15-alt3 +- do not package fence files +- add_findreq_skiplist for resource files + +* Wed Sep 14 2016 Alexey Shabalin 1.1.15-alt2 +- build with systemd support +- update sysv init script + +* Mon Jun 27 2016 Andrey Cherepanov 1.1.15-alt1 +- New version +- Security fix CVE-2016-7797 + +* Fri Jan 22 2016 Andrey Cherepanov 1.1.14-alt2 +- Fix initscripts and paths + +* Thu Jan 21 2016 Andrey Cherepanov 1.1.14-alt1 +- New version + +* Sat Oct 17 2015 Andrey Cherepanov 1.1.13-alt1 +- New version +- Security fix CVE-2015-1867 + +* Tue Nov 05 2013 Igor Vlasenko 1.1.10-alt4 +- NMU: added missing Pod dependencies + +* Thu Aug 15 2013 Slava Dubrovskiy 1.1.10-alt3 +- Fix initscript + +* Mon Aug 12 2013 Slava Dubrovskiy 1.1.10-alt2 +- New version + +* Mon May 27 2013 Slava Dubrovskiy 1.1.10-alt1.rc3 +- New RC + +* Sat Apr 06 2013 Slava Dubrovskiy 1.1.9-alt2.git.132019bd +- New version + +* Thu Mar 21 2013 Slava Dubrovskiy 1.1.9-alt1 +- Build for ALT diff --git a/pacemaker_remote.init b/pacemaker_remote.init new file mode 100755 index 000000000..59f7e980c --- /dev/null +++ b/pacemaker_remote.init @@ -0,0 +1,93 @@ +#!/bin/bash + +# Authors: +# Andrew Beekhof +# +# License: Revised BSD + +# chkconfig: - 99 01 +# description: Pacemaker Cluster Manager +# processname: pacemaker_remoted +# +### BEGIN INIT INFO +# Provides: pacemaker_remote +# Required-Start: $network $remote_fs +# Should-Start: $syslog +# Required-Stop: $network $remote_fs +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Starts and stops the Pacemaker remote agent for non-cluster nodes. +# Description: Starts and stops the Pacemaker remote agent for non-cluster nodes +### END INIT INFO + +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + +# Source function library. +. /etc/init.d/functions + +desc="Pacemaker Remote Agent" +prog="pacemaker_remoted" + +SourceIfNotEmpty /etc/sysconfig/pacemaker_remote +LOCKFILE="/var/lock/subsys/$prog" +PIDFILE="/var/run/$prog.pid" +RETVAL=0 + +start() +{ + start_daemon --make-pidfile --background --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $prog + RETVAL=$? + return $RETVAL +} + +stop() +{ + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $prog + RETVAL=$? + return $RETVAL +} + +restart() +{ + stop + start +} + + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + condrestart) + if [ -e "$LOCKFILE" ]; then + restart + fi + ;; + condreload) + if [ -e "$LOCKFILE" ]; then + reload + fi + ;; + condstop) + if [ -e "$LOCKFILE" ]; then + stop + fi + ;; + status) + status --expect-user root -- $prog + RETVAL=$? + ;; + *) + msg_usage "${0##*/} {start|stop|restart|reload|condrestart|condstop|condreload|status}" + RETVAL=1 +esac + +exit $RETVAL diff --git a/tools/crm_report.in b/tools/crm_report.in index 181887969..f859df7a0 100644 --- a/tools/crm_report.in +++ b/tools/crm_report.in @@ -24,7 +24,7 @@ cluster="any" ssh_user="root" search_logs=1 sos_mode=0 -report_data=`dirname $0` +report_data=/usr/share/pacemaker maxdepth=5 extra_logs=""