Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sapstartsrv-resource-agents for openSUSE:Factory checked in at 2023-05-05 15:59:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sapstartsrv-resource-agents (Old) and /work/SRC/openSUSE:Factory/.sapstartsrv-resource-agents.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sapstartsrv-resource-agents" Fri May 5 15:59:10 2023 rev:6 rq:1085006 version:0.9.2+git.1683278503.846fe15 Changes: -------- --- /work/SRC/openSUSE:Factory/sapstartsrv-resource-agents/sapstartsrv-resource-agents.changes 2022-09-21 14:44:21.566063443 +0200 +++ /work/SRC/openSUSE:Factory/.sapstartsrv-resource-agents.new.1533/sapstartsrv-resource-agents.changes 2023-05-05 15:59:26.756827926 +0200 @@ -1,0 +2,15 @@ +Fri May 5 08:18:17 UTC 2023 - abr...@suse.com + +- Version bump to 0.9.2 + * prevent systemd service race between sapping and sappond during + system boot + (bsc#1207138) + * fix a problem of monitor/probe operation to detect a running + sapstartsrv process + (bsc#1210790) + +- add python3-psutil as package requirement and as build + requirement in case of testing + needed for bsc#1210790 + +------------------------------------------------------------------- Old: ---- sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2.tar.gz New: ---- sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sapstartsrv-resource-agents.spec ++++++ --- /var/tmp/diff_new_pack.ukW6jG/_old 2023-05-05 15:59:27.296831020 +0200 +++ /var/tmp/diff_new_pack.ukW6jG/_new 2023-05-05 15:59:27.300831043 +0200 @@ -1,7 +1,7 @@ # # spec file for package sapstartsrv-resource-agents # -# Copyright (c) 2020-2022 SUSE LLC. +# Copyright (c) 2020-2023 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ License: GPL-2.0 Group: Productivity/Clustering/HA Summary: Resource agent for SAP instance specific sapstartsrv service -Version: 0.9.1+git.1663751963.e0ef8a2 +Version: 0.9.2+git.1683278503.846fe15 Release: 0 URL: https://github.com/SUSE/SAPStartSrv-resourceAgent Source0: %{name}-%{version}.tar.gz @@ -33,8 +33,10 @@ Requires: resource-agents Requires: pacemaker > 1.1.1 Requires: python3 +Requires: python3-psutil %if %{with test} BuildRequires: python3-pytest +BuildRequires: python3-psutil %endif %define raname SAPStartSrv ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ukW6jG/_old 2023-05-05 15:59:27.336831249 +0200 +++ /var/tmp/diff_new_pack.ukW6jG/_new 2023-05-05 15:59:27.340831272 +0200 @@ -4,8 +4,8 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">sapstartsrv-resource-agents</param> - <param name="versionformat">0.9.1+git.%ct.%h</param> - <param name="revision">e0ef8a2c4cf21d373f0085e4cd11fecb76ed87aa</param> + <param name="versionformat">0.9.2+git.%ct.%h</param> + <param name="revision">846fe156d95f7fbb1f8a1c02ee65b720f1404b98</param> </service> <service name="recompress" mode="disabled"> ++++++ sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2.tar.gz -> sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/.github/workflows/package-ci.yml new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/.github/workflows/package-ci.yml --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/.github/workflows/package-ci.yml 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/.github/workflows/package-ci.yml 2023-05-05 11:21:43.000000000 +0200 @@ -12,12 +12,12 @@ jobs: unit-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: python-version: [2.7, 3.6, 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} @@ -27,7 +27,7 @@ - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-cov mock + pip install pytest pytest-cov mock psutil - name: Test with pytest run: py.test -vv --cov=SAPStartSrv --cov-config .coveragerc --cov-report term --cov-report xml tests - name: Publish code coverage @@ -40,7 +40,7 @@ delivery: needs: unit-tests - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: ${{ github.event_name != 'pull_request' }} container: image: shap/continuous_deliver @@ -49,7 +49,7 @@ OBS_PASS: ${{ secrets.OBS_PASS }} OBS_PROJECT: ${{ secrets.OBS_PROJECT }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home @@ -67,7 +67,7 @@ submission: needs: [unit-tests, delivery] - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} container: image: shap/continuous_deliver @@ -77,7 +77,7 @@ OBS_PROJECT: ${{ secrets.OBS_PROJECT }} TARGET_PROJECT: ${{ secrets.TARGET_PROJECT }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: configure OSC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/_service new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/_service --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/_service 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/_service 2023-05-05 11:21:43.000000000 +0200 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">sapstartsrv-resource-agents</param> - <param name="versionformat">0.9.1+git.%ct.%h</param> + <param name="versionformat">0.9.2+git.%ct.%h</param> <param name="revision">%%VERSION%%</param> </service> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/man/SAPStartSrv_basic_cluster.7 new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/man/SAPStartSrv_basic_cluster.7 --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/man/SAPStartSrv_basic_cluster.7 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/man/SAPStartSrv_basic_cluster.7 2023-05-05 11:21:43.000000000 +0200 @@ -1,6 +1,6 @@ .\" Version: 0.9.1 .\" -.TH SAPStartSrv_basic_cluster 7 "02 Feb 2022" "" "SAPStartSrv" +.TH SAPStartSrv_basic_cluster 7 "30 Jan 2023" "" "SAPStartSrv" .\" .SH NAME SAPStartSrv_basic_cluster \- basic settings to make SAPStartSrv work @@ -286,6 +286,17 @@ .RE .br .PP +\fB* check saphostagent and show SAP instances\fR +.PP +Basic check for the saphostagent. +.PP +.RS 4 +# /usr/sap/hostctrl/exe/saphostctrl -function Ping +.br +# /usr/sap/hostctrl/exe/saphostctrl -function ListInstances +.RE +.br +.PP \fB* SAP instance profile\fR .PP Check the instance profile for HA specific settings. @@ -334,10 +345,15 @@ .TP /etc/fstab filesystem table, for statically mounted NFS shares +.TP +/etc/systemd/system/SAP<SID>_<NR>.service +systemd unit file for SAP instance .\" TODO .PP .\" .SH BUGS +In case of any problem, please use your favourite SAP support process to open +a request for the component BC-OP-LNX-SUSE. Please report feedback and suggestions to feedb...@suse.com. .PP .\" @@ -347,6 +363,15 @@ \fBattrd_updater\fP(8) , \fBsbd\fP(8) , \fBstonith_sbd\fP(8) , \fBcrm\fP(8) , \fBcorosync.conf\fP(5) , \fBvotequorum\fP(5) , \fBhosts\fP(5) , \fBfstab\fP(5) , \fBpasswd\fP(5) , \fBgroups\fP(8) , \fBusermod\fP(8) , \fBchrony.conf\fP(5) , +\fBsystemctl\fP(1) , +\fBsystemd-cgls\fP(1) , \fBsystemd-analyze\fP(1) , \fBsystemd-delta\fP(1) , +\fBha_related_suse_tids\fP(7) , \fBha_related_sap_notes\fP(7) , +.br +https://documentation.suse.com/sbp/all/?context=sles-sap , +.br +https://documentation.suse.com/sles-sap/ , +.br +https://www.suse.com/support/kb/ , .br https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt .\" TODO https://pracucci.com/linux-tcp-rto-min-max-and-tcp-retries2.html @@ -359,7 +384,7 @@ .\" .SH COPYRIGHT .br -(c) 2020-2022 SUSE LLC +(c) 2020-2023 SUSE LLC .br SAPStartSrv comes with ABSOLUTELY NO WARRANTY. .br diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/ra/SAPStartSrv.in new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/ra/SAPStartSrv.in --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/ra/SAPStartSrv.in 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/ra/SAPStartSrv.in 2023-05-05 11:21:43.000000000 +0200 @@ -2,25 +2,26 @@ # - *- coding: utf- 8 - *- # # -# Description: Manages a single sapstartrv on an SAP Instance as a High-Availability -# resource. +# Description: Manages a single sapstartrv on an SAP Instance as +# a High-Availability resource. # # Author: Xabier Arbulu, September 2020 # Based on code from: Fabian Herschel # Support: # License: GNU General Public License (GPL) -# Copyright: (c) 2020-2022 SUSE LLC +# Copyright: (c) 2020-2023 SUSE LLC # # An example usage: # See usage() function below for more details... # # OCF instance parameters: # - OCF_RESKEY_InstanceName -# - not currently OCF_RESKEY_START_PROFILE (optional, well known directories will be -# searched by default) +# - not currently OCF_RESKEY_START_PROFILE (optional, well known +# directories will be searched by default) # -# - supports sapstartsrv for SAP instances NW7.40 or newer, SAP S/4HANA ABAP Platform 1909 -# or newer (central services and enqueue replication) +# - supports sapstartsrv for SAP instances NW7.40 or newer, +# SAP S/4HANA ABAP Platform 1909 or newer +# (central services and enqueue replication) # - MUST NOT be used for SAP HANA in system replication # - MUST NOT be used for SAP HANA standalone Scale-Up or Scale-Out systems # @@ -31,6 +32,7 @@ import re import subprocess import shlex +import psutil OCF_FUNCTIONS_DIR = os.environ.get( "OCF_FUNCTIONS_DIR", @@ -38,7 +40,7 @@ sys.path.append(OCF_FUNCTIONS_DIR) import ocf # noqa: E402 -from ocf import logger +from ocf import logger # noqa: E402 LONG_DESC = '''Long description of SAPStartSrv to be done (python version)''' @@ -105,12 +107,23 @@ ''' Get sapstartsrv status returning ProcessResult object ''' - result = run_command( - 'pgrep -f -l "sapstartsrv.*pf=.*{}_{}_{}"'.format( - self.sid, self.instance_name, self.virtual_host)) - if result.returncode == 0 and not re.match(r'.*\bsapstartsrv\b.*', result.output): - result.returncode = 1 - logger.info('Current status: %d. Output: %s' % (result.returncode, result.output)) + sap_inst_pf = 'pf={}'.format(self.sap_instance_profile) + result = 1 + res_out = 'No running sapstartsrv process found for {} with {}'.format( + self.saptstartsrv_path, sap_inst_pf) + for process in psutil.process_iter(['pid', 'ppid', 'name', 'cmdline']): + try: + cmdline = process.cmdline() + except (psutil.AccessDenied, psutil.ZombieProcess, psutil.NoSuchProcess): + continue + if process.name() == "sapstartsrv": + if self.saptstartsrv_path in cmdline and sap_inst_pf in cmdline: + result = 0 + res_out = 'Found runnig sapstartsrv process - PID:{} PPID:{} CMDLINE:{}'.format( + process.pid, process.ppid(), cmdline) + break + + logger.info('Current status: %d. Output: %s' % (result, res_out)) return result def _find_executables(self): @@ -277,8 +290,7 @@ start_result = run_command('{} pf={} -D -u {}'.format( self.saptstartsrv_path, self.sap_instance_profile, self.sidadm)) - result = self._get_status() - if result.returncode == 0: + if self._get_status() == 0: logger.info( 'sapstartsrv for SAP Instance %s_%s started: %s' % (self.sid, self.instance_name, start_result.output)) @@ -305,8 +317,7 @@ Run sapcontrol command with StopService ''' self._inititialize() - result = self._get_status() - if result.returncode == 0: + if self._get_status() == 0: stop_result = run_command( '{} -nr {} -function StopService'.format( self.sapcontrol_path, self.instance_number)) @@ -330,8 +341,7 @@ Get sapstartsrv status ''' self._inititialize() - result = self._get_status() - if result.returncode == 0: + if self._get_status() == 0: return ocf.OCF_SUCCESS return ocf.OCF_NOT_RUNNING @@ -342,7 +352,7 @@ ''' self._inititialize() if ocf.is_probe(): - if self._get_status().returncode == 0: + if self._get_status() == 0: return ocf.OCF_SUCCESS return ocf.OCF_NOT_RUNNING diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/sapstartsrv-resource-agents.changes new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/sapstartsrv-resource-agents.changes --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/sapstartsrv-resource-agents.changes 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/sapstartsrv-resource-agents.changes 2023-05-05 11:21:43.000000000 +0200 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Fri May 5 08:18:17 UTC 2023 - abr...@suse.com + +- Version bump to 0.9.2 + * prevent systemd service race between sapping and sappond during + system boot + (bsc#1207138) + * fix a problem of monitor/probe operation to detect a running + sapstartsrv process + (bsc#1210790) + +- add python3-psutil as package requirement and as build + requirement in case of testing + needed for bsc#1210790 + +------------------------------------------------------------------- Wed Sep 14 09:37:25 UTC 2022 - abr...@suse.com - Version bump to 0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/sapstartsrv-resource-agents.spec new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/sapstartsrv-resource-agents.spec --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/sapstartsrv-resource-agents.spec 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/sapstartsrv-resource-agents.spec 2023-05-05 11:21:43.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package sapstartsrv-resource-agents # -# Copyright (c) 2020-2022 SUSE LLC. +# Copyright (c) 2020-2023 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -33,8 +33,10 @@ Requires: resource-agents Requires: pacemaker > 1.1.1 Requires: python3 +Requires: python3-psutil %if %{with test} BuildRequires: python3-pytest +BuildRequires: python3-psutil %endif %define raname SAPStartSrv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/service/sappong.service new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/service/sappong.service --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/service/sappong.service 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/service/sappong.service 2023-05-05 11:21:43.000000000 +0200 @@ -1,7 +1,7 @@ [Unit] Description=Unhiding sapservices file from sapinit Documentation=man:sapservices-move(8) -After=sapinit.service +After=sapinit.service sapping.service [Service] Type=oneshot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/tests/SAPStartSrv_test.py new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/tests/SAPStartSrv_test.py --- old/sapstartsrv-resource-agents-0.9.1+git.1663751963.e0ef8a2/tests/SAPStartSrv_test.py 2022-09-21 11:19:23.000000000 +0200 +++ new/sapstartsrv-resource-agents-0.9.2+git.1683278503.846fe15/tests/SAPStartSrv_test.py 2023-05-05 11:21:43.000000000 +0200 @@ -234,36 +234,6 @@ '/etc/systemd/system/SAPPRD_00.service' ) - @mock.patch('ocf.logger.info') - @mock.patch('SAPStartSrv.run_command') - def test_get_status(self, mock_run_command, mock_logger): - - mock_result = mock.Mock(output=' sapstartsrv ', returncode=0) - mock_run_command.return_value = mock_result - self._agent.sid = 'PRD' - self._agent.instance_name = 'ASCS00' - self._agent.virtual_host = 'virthost' - - result = self._agent._get_status() - assert result == mock_result - mock_run_command.assert_called_once_with( - 'pgrep -f -l "sapstartsrv.*pf=.*PRD_ASCS00_virthost"') - mock_logger.assert_called_once_with('Current status: 0. Output: sapstartsrv ') - - mock_run_command.reset_mock() - mock_logger.reset_mock() - mock_result = mock.Mock(output='output', returncode=0) - mock_run_command.return_value = mock_result - self._agent.sid = 'PRD' - self._agent.instance_name = 'ASCS00' - self._agent.virtual_host = 'virthost' - - result = self._agent._get_status() - assert result == mock_result - mock_run_command.assert_called_once_with( - 'pgrep -f -l "sapstartsrv.*pf=.*PRD_ASCS00_virthost"') - mock_logger.assert_called_once_with('Current status: 1. Output: output') - @mock.patch('ocf.OCF_SUCCESS', 0) @mock.patch('ocf.have_binary') @mock.patch('ocf.get_parameter') @@ -559,8 +529,7 @@ start_mock = mock.Mock(output='output', err='error') mock_run_command.side_effect = [None, None, start_mock] - get_status_result_mock = mock.Mock(returncode=0) - get_status_mock = mock.Mock(return_value=get_status_result_mock) + get_status_mock = mock.Mock(return_value=0) self._agent._get_status = get_status_mock ocf_returncode = self._agent._start_sys5_style() @@ -589,8 +558,7 @@ start_sys5_style_mock = mock.Mock(output='output', err='error') mock_run_command.side_effect = [None, None, start_sys5_style_mock] - get_status_result_mock = mock.Mock(returncode=1) - get_status_mock = mock.Mock(return_value=get_status_result_mock) + get_status_mock = mock.Mock(return_value=1) self._agent._get_status = get_status_mock ocf_returncode = self._agent._start_sys5_style() @@ -768,7 +736,7 @@ mock_command = mock.Mock(output='output', err='error', returncode=0) mock_run_command.return_value = mock_command - self._agent._get_status = mock.Mock(return_value=mock.Mock(returncode=0)) + self._agent._get_status = mock.Mock(return_value=0) ocf_returncode = self._agent.stop() assert ocf_returncode == 0 @@ -789,7 +757,7 @@ self._agent.instance_name = 'ASCS00' self._agent.sid = 'PRD' - self._agent._get_status = mock.Mock(return_value=mock.Mock(returncode=1)) + self._agent._get_status = mock.Mock(return_value=1) ocf_returncode = self._agent.stop() assert ocf_returncode == 0 @@ -815,7 +783,7 @@ mock_command = mock.Mock(output='output', err='error', returncode=1) mock_run_command.return_value = mock_command - self._agent._get_status = mock.Mock(return_value=mock.Mock(returncode=0)) + self._agent._get_status = mock.Mock(return_value=0) ocf_returncode = self._agent.stop() assert ocf_returncode == 1 @@ -831,7 +799,7 @@ @mock.patch('ocf.OCF_SUCCESS', 0) def test_status_success(self): self._agent._inititialize = mock.Mock() - get_status_mock = mock.Mock(return_value=mock.Mock(returncode=0)) + get_status_mock = mock.Mock(return_value=0) self._agent._get_status = get_status_mock ocf_returncode = self._agent.status() @@ -855,7 +823,7 @@ @mock.patch('ocf.is_probe') def test_monitor_success(self, mock_is_probe): self._agent._inititialize = mock.Mock() - get_status_mock = mock.Mock(return_value=mock.Mock(returncode=0)) + get_status_mock = mock.Mock(return_value=0) self._agent._get_status = get_status_mock mock_is_probe.return_value = True