StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
parent
54fbc09be7
commit
2c0bd269ba
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/downloads
|
||||
installer-prebuilt
|
||||
.idea
|
||||
*.egg-info
|
||||
*.swp
|
||||
*.pyc
|
||||
.cache/
|
202
LICENSE
Normal file
202
LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
251
centos_pkg_dirs
Normal file
251
centos_pkg_dirs
Normal file
@ -0,0 +1,251 @@
|
||||
mwa-thales/nova-api-proxy
|
||||
mwa-perian/ceph
|
||||
mwa-perian/ceph-manager
|
||||
mwa-chilon/tsconfig
|
||||
mwa-pitta/compute-huge
|
||||
mwa-pitta/computeconfig
|
||||
mwa-pitta/configutilities
|
||||
mwa-pitta/controllerconfig
|
||||
mwa-pitta/storageconfig
|
||||
mwa-cleo/fm-api
|
||||
mwa-cleo/fm-common
|
||||
mwa-cleo/fm-mgr
|
||||
mwa-cleo/fm-doc
|
||||
middleware/filesystem/recipes-common/logmgmt
|
||||
middleware/filesystem/recipes-control/filesystem-scripts
|
||||
middleware/io-monitor/recipes-common/io-monitor
|
||||
mwa-beas/mtce-common
|
||||
mwa-beas/mtce-compute
|
||||
mwa-beas/mtce-control
|
||||
mwa-beas/mtce-storage
|
||||
middleware/recipes-common/build-info
|
||||
mwa-gplv2/dpkg
|
||||
mwa-pitta/sysinv/cgts-client
|
||||
mwa-pitta/sysinv/sysinv-agent
|
||||
mwa-pitta/sysinv/sysinv
|
||||
mwa-thales/guest-client
|
||||
mwa-thales/guest-agent
|
||||
mwa-thales/guest-comm
|
||||
middleware/branding/recipes-control/wrs-branding
|
||||
middleware/perf/recipes-common/io-scheduler
|
||||
middleware/util/recipes-common/collector
|
||||
mwa-perian/openstack/openstack-aodh
|
||||
mwa-perian/openstack/openstack-murano
|
||||
mwa-perian/openstack/python-muranoclient
|
||||
mwa-perian/openstack/openstack-murano-ui
|
||||
mwa-perian/openstack/openstack-ironic
|
||||
mwa-perian/openstack/python-ironicclient
|
||||
mwa-perian/openstack/python-magnumclient
|
||||
mwa-perian/openstack/openstack-magnum
|
||||
mwa-perian/openstack/openstack-magnum-ui
|
||||
mwa-perian/openstack/openstack-ras
|
||||
mwa-perian/openstack/openstack-panko
|
||||
mwa-perian/openstack/python-ceilometer
|
||||
mwa-perian/openstack/python-ceilometerclient
|
||||
mwa-perian/openstack/python-cinder
|
||||
mwa-perian/openstack/python-cinderclient
|
||||
mwa-perian/openstack/python-glance
|
||||
mwa-perian/openstack/python-glance-store
|
||||
mwa-perian/openstack/python-glanceclient
|
||||
mwa-perian/openstack/python-heat/openstack-heat
|
||||
mwa-perian/openstack/python-heat/wrs-heat-template
|
||||
mwa-perian/openstack/python-heatclient
|
||||
mwa-perian/openstack/python-horizon
|
||||
mwa-perian/openstack/python-keystone
|
||||
mwa-perian/openstack/python-keystoneclient
|
||||
mwa-perian/openstack/python-keystonemiddleware
|
||||
mwa-perian/openstack/python-networking-bgpvpn
|
||||
mwa-perian/openstack/python-networking-sfc
|
||||
mwa-perian/openstack/python-networking-odl
|
||||
mwa-perian/openstack/python-neutron
|
||||
mwa-perian/openstack/python-neutron-dynamic-routing
|
||||
mwa-perian/openstack/python-neutron-lib
|
||||
mwa-perian/openstack/python-neutronclient
|
||||
mwa-perian/openstack/python-nova
|
||||
mwa-perian/openstack/python-novaclient
|
||||
mwa-perian/openstack/python-openstackdocstheme
|
||||
mwa-perian/openstack/python-oslo-concurrency
|
||||
mwa-perian/openstack/python-oslo-service
|
||||
mwa-perian/openstack/python-oslo-messaging
|
||||
mwa-perian/openstack/rabbitmq-server
|
||||
mwa-sparta/vm-topology
|
||||
mwa-perian/openstack/python-keystoneauth1
|
||||
mwa-perian/openstack/python-openstackclient
|
||||
mwa-perian/openstack/python-osc-lib
|
||||
mwa-perian/openstack/python-openstacksdk
|
||||
mwa-perian/openstack/python-django-openstack-auth
|
||||
mwa-delphi/remote-clients
|
||||
mwa-delphi/install-log-server
|
||||
mwa-sparta/core/initscripts
|
||||
mwa-sparta/core/util-linux
|
||||
mwa-sparta/base/setup
|
||||
mwa-sparta/base/lshell
|
||||
mwa-gplv2/cgcs-users
|
||||
mwa-sparta/base/namespace-utils
|
||||
mwa-sparta/base/nss-pam-ldapd
|
||||
mwa-sparta/base/centos-release
|
||||
mwa-sparta/base/expect-lite
|
||||
mwa-gplv2/cluster-resource-agents
|
||||
mwa-sparta/connectivity/nfs-utils
|
||||
mwa-sparta/connectivity/dhcp
|
||||
mwa-sparta/connectivity/openssh
|
||||
mwa-sparta/devtools/facter
|
||||
mwa-sparta/devtools/qemu
|
||||
mwa-gplv2/rpm
|
||||
mwa-gplv2/libfdt
|
||||
mwa-sparta/devtools/nfscheck/recipes-common/nfscheck
|
||||
mwa-sparta/devtools/update-motd
|
||||
mwa-sparta/devtools/vim
|
||||
mwa-sparta/devtools/python/python-django
|
||||
mwa-gplv3/python-psycopg2
|
||||
mwa-sparta/devtools/python-setuptools
|
||||
mwa-gplv2/bash
|
||||
mwa-sparta/extended/e2fsprogs
|
||||
mwa-gplv3/crontabs
|
||||
mwa-gplv2/haproxy
|
||||
mwa-gplv2/iptables
|
||||
mwa-gplv2/iscsi-initiator-utils
|
||||
mwa-gplv2/ldapscripts
|
||||
mwa-sparta/extended/libvirt
|
||||
mwa-sparta/extended/libvirt-python
|
||||
mwa-sparta/extended/lighttpd
|
||||
mwa-gplv2/netpbm
|
||||
mwa-gplv3/parted
|
||||
mwa-sparta/extended/python-cephclient
|
||||
mwa-gplv3/python-keyring
|
||||
mwa-sparta/extended/python-ryu
|
||||
mwa-sparta/extended/python-smartpm
|
||||
mwa-sparta/extended/lldpd
|
||||
mwa-sparta/extended/logrotate
|
||||
mwa-sparta/extended/nova-utils
|
||||
mwa-sparta/extended/ntp
|
||||
mwa-sparta/extended/pam
|
||||
mwa-gplv3/rsync
|
||||
mwa-sparta/extended/shadow
|
||||
mwa-sparta/extended/shim-unsigned
|
||||
mwa-sparta/extended/shim-signed
|
||||
mwa-sparta/extended/syslog-ng
|
||||
mwa-gplv2/net-tools
|
||||
mwa-sparta/extended/novnc
|
||||
mwa-sparta/extended/sanlock
|
||||
mwa-sparta/extended/sudo
|
||||
mwa-sparta/extended/cloud-init
|
||||
mwa-sparta/extended/irqbalance
|
||||
mwa-sparta/extended/watchdog
|
||||
mwa-gplv3/seabios
|
||||
mwa-gplv2/tpmdd
|
||||
mwa-gplv2/integrity
|
||||
mwa-gplv2/drbd
|
||||
mwa-gplv2/drbd-tools
|
||||
mwa-gplv2/intel-e1000e
|
||||
mwa-gplv2/intel-i40e
|
||||
mwa-gplv2/intel-i40evf
|
||||
mwa-gplv2/intel-ixgbe
|
||||
mwa-gplv2/intel-ixgbevf
|
||||
mwa-gplv2/qat17
|
||||
mwa-sparta/networking/net-snmp
|
||||
mwa-sparta/networking/openldap
|
||||
mwa-sparta/networking/mlx4-config
|
||||
mwa-sparta/networking/openvswitch
|
||||
mwa-sparta/networking/scapy
|
||||
mwa-thales/nfv
|
||||
mwa-sparta/restapi-doc
|
||||
mwa-gplv3/grub2
|
||||
recipes-bsp/grubby
|
||||
mwa-gplv3/dnsmasq
|
||||
mwa-sparta/support/libevent
|
||||
mwa-sparta/support/tgt
|
||||
mwa-solon/service-mgmt/sm-common-1.0.0
|
||||
mwa-solon/service-mgmt/sm-db-1.0.0
|
||||
mwa-solon/service-mgmt/sm-1.0.0
|
||||
mwa-solon/service-mgmt-api
|
||||
mwa-solon/service-mgmt-client
|
||||
mwa-solon/service-mgmt-tools
|
||||
mwa-sparta/security/wrs-ssl
|
||||
mwa-sparta/security/tss2
|
||||
mwa-sparta/security/tpm2-tools
|
||||
mwa-sparta/security/tpm2-openssl-engine
|
||||
mwa-sparta/security/libtpms
|
||||
mwa-sparta/security/swtpm
|
||||
mwa-sparta/security/audit
|
||||
mwa-cleo/snmp-ext
|
||||
middleware/util/recipes-common/libtrap-handler
|
||||
mwa-chilon/cgcs-patch
|
||||
mwa-chilon/patch-alarm
|
||||
middleware/patching/recipes-common/enable-dev-patch
|
||||
middleware/util/recipes-common/platform-util
|
||||
middleware/util/recipes-common/monitor-tools
|
||||
middleware/util/recipes-common/engtools/hostdata-collectors
|
||||
mwa-sparta/kernel-std
|
||||
mwa-sparta/devtools/puppet-4.8.2
|
||||
mwa-beas/installer/pxe-network-installer
|
||||
mwa-pitta/config-gate
|
||||
mwa-chilon/requests-toolbelt
|
||||
mwa-perian/openstack/python-wsme
|
||||
mwa-pitta/puppet-manifests
|
||||
mwa-sparta/devtools/puppet-modules/puppet-ovs_dpdk
|
||||
mwa-sparta/devtools/puppet-modules/puppet-boolean-1.0.2
|
||||
mwa-sparta/devtools/puppet-modules/puppet-create_resources
|
||||
mwa-sparta/devtools/puppet-modules/puppet-dnsmasq
|
||||
mwa-sparta/devtools/puppet-modules/puppet-drbd-0.3.1
|
||||
mwa-sparta/devtools/puppet-modules/puppet-filemapper
|
||||
mwa-sparta/devtools/puppet-modules/puppet-haproxy-1.5.0
|
||||
mwa-sparta/devtools/puppet-modules/puppet-ldap
|
||||
mwa-sparta/devtools/puppet-modules/puppet-lvm
|
||||
mwa-sparta/devtools/puppet-modules/puppet-network
|
||||
mwa-sparta/devtools/puppet-modules/puppet-nslcd
|
||||
mwa-sparta/devtools/puppet-modules/puppet-postgresql-4.8.0
|
||||
mwa-sparta/devtools/puppet-modules/puppet-puppi
|
||||
mwa-sparta/devtools/puppet-modules/puppet-rabbitmq-5.5.0
|
||||
mwa-sparta/devtools/puppet-modules/puppet-staging
|
||||
mwa-sparta/devtools/puppet-modules/puppet-stdlib-4.12.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-ceilometer-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-ceph-2.2.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-cinder-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-glance-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-heat-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-ironic-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-keystone-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-murano-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-magnum-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-neutron-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-nova-11.4.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-openstacklib-11.3.0
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-panko-11.3.0
|
||||
mwa-pitta/puppet-modules-wrs/puppet-mtce
|
||||
mwa-pitta/puppet-modules-wrs/puppet-sshd
|
||||
mwa-pitta/puppet-modules-wrs/puppet-nfv
|
||||
mwa-pitta/puppet-modules-wrs/puppet-nova_api_proxy
|
||||
mwa-pitta/puppet-modules-wrs/puppet-patching
|
||||
mwa-pitta/puppet-modules-wrs/puppet-sysinv
|
||||
mwa-pitta/puppet-modules-wrs/puppet-dcorch
|
||||
mwa-pitta/puppet-modules-wrs/puppet-dcmanager
|
||||
mwa-sparta/base/tis-extensions
|
||||
mwa-sparta/python/python-eventlet
|
||||
mwa-sparta/python/python-requests
|
||||
mwa-chilon/patch-scripts/EXAMPLE_0001
|
||||
mwa-chilon/patch-scripts/EXAMPLE_0002
|
||||
mwa-chilon/patch-scripts/EXAMPLE_0003
|
||||
mwa-chilon/patch-scripts/EXAMPLE_RR
|
||||
mwa-chilon/patch-scripts/EXAMPLE_MTCE
|
||||
mwa-chilon/patch-scripts/EXAMPLE_NEUTRON
|
||||
mwa-chilon/patch-scripts/EXAMPLE_AODH
|
||||
mwa-chilon/patch-scripts/EXAMPLE_HEAT
|
||||
mwa-chilon/patch-scripts/EXAMPLE_VIM
|
||||
mwa-chilon/patch-scripts/EXAMPLE_NOVA
|
||||
mwa-chilon/patch-scripts/EXAMPLE_SYSINV
|
||||
mwa-gplv2/mariadb
|
||||
mwa-sparta/extended/systemd
|
||||
mwa-sparta/extended/python-gunicorn
|
||||
mwa-sparta/devtools/puppet-modules/openstack/puppet-oslo-11.3.0
|
||||
mwa-cleo/snmp-audittrail
|
||||
mwa-sparta/python/python-3parclient
|
||||
mwa-sparta/python/python-lefthandclient
|
||||
mwa-sparta/extended/iproute
|
||||
mwa-perian/openstack/distributedcloud
|
||||
mwa-perian/openstack/distributedcloud-client
|
||||
mwa-sparta/extended/tboot
|
||||
mwa-beas/kickstart
|
||||
mwa-sparta/mellanox/libibverbs
|
||||
mwa-sparta/mellanox/mlnx-ofa_kernel
|
||||
mwa-sparta/mellanox/rdma-core
|
2
centos_pkg_dirs_installer
Normal file
2
centos_pkg_dirs_installer
Normal file
@ -0,0 +1,2 @@
|
||||
mwa-gplv2/rpm
|
||||
mwa-gplv3/anaconda
|
13
centos_pkg_dirs_rt
Normal file
13
centos_pkg_dirs_rt
Normal file
@ -0,0 +1,13 @@
|
||||
mwa-sparta/kernel-rt
|
||||
mwa-gplv2/intel-e1000e
|
||||
mwa-gplv2/intel-i40e
|
||||
mwa-gplv2/intel-i40evf
|
||||
mwa-gplv2/intel-ixgbe
|
||||
mwa-gplv2/intel-ixgbevf
|
||||
mwa-gplv2/qat17
|
||||
mwa-gplv2/drbd
|
||||
mwa-gplv2/tpmdd
|
||||
mwa-gplv2/integrity
|
||||
mwa-sparta/mellanox/libibverbs
|
||||
mwa-sparta/mellanox/mlnx-ofa_kernel
|
||||
mwa-sparta/mellanox/rdma-core
|
16
extras/scripts/make_patch.sh
Executable file
16
extras/scripts/make_patch.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd `dirname $0` > /dev/null
|
||||
SCRIPTPATH=`pwd`
|
||||
popd > /dev/null
|
||||
|
||||
# CGCSPATCH_DIR=$MY_REPO/addons/wr-cgcs/layers/cgcs/middleware/patching/recipes-common/cgcs-patch
|
||||
CGCSPATCH_DIR=$SCRIPTPATH/../../middleware/patching/recipes-common/cgcs-patch
|
||||
|
||||
# Set environment variables for python
|
||||
export PYTHONPATH=$CGCSPATCH_DIR/cgcs-patch
|
||||
export PYTHONDONTWRITEBYTECODE=true
|
||||
|
||||
# Run the patch_build tool
|
||||
exec $CGCSPATCH_DIR/bin/make_patch "$@"
|
||||
|
16
extras/scripts/modify_patch.sh
Executable file
16
extras/scripts/modify_patch.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd `dirname $0` > /dev/null
|
||||
SCRIPTPATH=`pwd`
|
||||
popd > /dev/null
|
||||
|
||||
# CGCSPATCH_DIR=$MY_REPO/addons/wr-cgcs/layers/cgcs/middleware/patching/recipes-common/cgcs-patch
|
||||
CGCSPATCH_DIR=$SCRIPTPATH/../../middleware/patching/recipes-common/cgcs-patch
|
||||
|
||||
# Set environment variables for python
|
||||
export PYTHONPATH=$CGCSPATCH_DIR/cgcs-patch
|
||||
export PYTHONDONTWRITEBYTECODE=true
|
||||
|
||||
# Run the patch_build tool
|
||||
exec $CGCSPATCH_DIR/bin/modify_patch "$@"
|
||||
|
15
extras/scripts/patch_build.sh
Executable file
15
extras/scripts/patch_build.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
CGCSPATCH_DIR=$MY_REPO/addons/wr-cgcs/layers/cgcs/middleware/patching/recipes-common/cgcs-patch
|
||||
|
||||
# Source release-info
|
||||
. $MY_REPO/addons/wr-cgcs/layers/cgcs/middleware/recipes-common/build-info/release-info.inc
|
||||
export PLATFORM_RELEASE
|
||||
|
||||
# Set environment variables for python
|
||||
export PYTHONPATH=$CGCSPATCH_DIR/cgcs-patch
|
||||
export PYTHONDONTWRITEBYTECODE=true
|
||||
|
||||
# Run the patch_build tool
|
||||
exec $CGCSPATCH_DIR/bin/patch_build "$@"
|
||||
|
16
extras/scripts/query_patch.sh
Executable file
16
extras/scripts/query_patch.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd `dirname $0` > /dev/null
|
||||
SCRIPTPATH=`pwd`
|
||||
popd > /dev/null
|
||||
|
||||
# CGCSPATCH_DIR=$MY_REPO/addons/wr-cgcs/layers/cgcs/middleware/patching/recipes-common/cgcs-patch
|
||||
CGCSPATCH_DIR=$SCRIPTPATH/../../middleware/patching/recipes-common/cgcs-patch
|
||||
|
||||
# Set environment variables for python
|
||||
export PYTHONPATH=$CGCSPATCH_DIR/cgcs-patch
|
||||
export PYTHONDONTWRITEBYTECODE=true
|
||||
|
||||
# Run the patch_build tool
|
||||
exec $CGCSPATCH_DIR/bin/query_patch "$@"
|
||||
|
47
git/.gitignore
vendored
Normal file
47
git/.gitignore
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/api-site
|
||||
/ceilometer
|
||||
/cinder
|
||||
/compute-api
|
||||
/glance
|
||||
/heat
|
||||
/horizon
|
||||
/identity-api
|
||||
/image-api
|
||||
/ironic
|
||||
/python-ironicclient
|
||||
/keystone
|
||||
/magnum
|
||||
/magnum-ui
|
||||
/netconn-api
|
||||
/neutron
|
||||
/nova
|
||||
/object-api
|
||||
/python-ceilometerclient
|
||||
/python-neutronclient
|
||||
/python-novaclient
|
||||
/libvirt
|
||||
/qemu
|
||||
/networking-odl
|
||||
/packstack
|
||||
/python-cinderclient
|
||||
/python-glanceclient
|
||||
/python-openstacksdk
|
||||
/pktgen-dpdk
|
||||
/murano
|
||||
/murano-dashboard
|
||||
/python-magnumclient
|
||||
/python-muranoclient
|
||||
/openstack-ras
|
||||
/python-lefthandclient
|
||||
/python-3parclient
|
||||
/ceph
|
||||
/seabios
|
||||
/neutron-dynamic-routing
|
||||
/networking-bgpvpn
|
||||
/ryu
|
||||
/ima-evm-utils
|
||||
/rpm
|
||||
/distributedcloud
|
||||
/distributedcloud-client
|
||||
/networking-sfc
|
||||
/neutron-lib
|
1
git/ceilometer.txt
Normal file
1
git/ceilometer.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/ceilometer
|
1
git/ceph.txt
Normal file
1
git/ceph.txt
Normal file
@ -0,0 +1 @@
|
||||
git.ceph.com/ceph.git
|
1
git/cinder.txt
Normal file
1
git/cinder.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/cinder
|
1
git/distributedcloud-client.txt
Normal file
1
git/distributedcloud-client.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-kingbirdclient
|
1
git/distributedcloud.txt
Normal file
1
git/distributedcloud.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/kingbird
|
1
git/glance.txt
Normal file
1
git/glance.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/glance
|
1
git/heat.txt
Normal file
1
git/heat.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/heat
|
1
git/horizon.txt
Normal file
1
git/horizon.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/horizon
|
1
git/ima-evm-utils.txt
Normal file
1
git/ima-evm-utils.txt
Normal file
@ -0,0 +1 @@
|
||||
git.code.sf.net/p/linux-ima/ima-evm-utils
|
1
git/keystone.txt
Normal file
1
git/keystone.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/keystone
|
1
git/libvirt.txt
Normal file
1
git/libvirt.txt
Normal file
@ -0,0 +1 @@
|
||||
libvirt.org/libvirt
|
1
git/magnum-ui.txt
Normal file
1
git/magnum-ui.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/magnum-ui
|
1
git/magnum.txt
Normal file
1
git/magnum.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/magnum
|
1
git/murano-dashboard.txt
Normal file
1
git/murano-dashboard.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/murano-dashboard
|
1
git/murano.txt
Normal file
1
git/murano.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/murano
|
1
git/networking-bgpvpn.txt
Normal file
1
git/networking-bgpvpn.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/networking-bgpvpn
|
1
git/networking-odl.txt
Normal file
1
git/networking-odl.txt
Normal file
@ -0,0 +1 @@
|
||||
git.openstack.org/openstack/networking-odl
|
1
git/networking-sfc.txt
Normal file
1
git/networking-sfc.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/networking-sfc
|
1
git/neutron-dynamic-routing.txt
Normal file
1
git/neutron-dynamic-routing.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/neutron-dynamic-routing
|
1
git/neutron.txt
Normal file
1
git/neutron.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/neutron
|
1
git/nova.txt
Normal file
1
git/nova.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/nova
|
1
git/openstack-ras.txt
Normal file
1
git/openstack-ras.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/openstack-resource-agents
|
1
git/packstack.txt
Normal file
1
git/packstack.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/packstack
|
1
git/pktgen-dpdk.txt
Normal file
1
git/pktgen-dpdk.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/pktgen/pktgen-dpdk
|
1
git/python-3parclient.txt
Normal file
1
git/python-3parclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/hpe-storage/python-3parclient
|
2
git/python-ceilometerclient.txt
Normal file
2
git/python-ceilometerclient.txt
Normal file
@ -0,0 +1,2 @@
|
||||
github.com/openstack/python-ceilometerclient
|
||||
|
1
git/python-cinderclient.txt
Normal file
1
git/python-cinderclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-cinderclient
|
1
git/python-glanceclient.txt
Normal file
1
git/python-glanceclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-glanceclient
|
1
git/python-lefthandclient.txt
Normal file
1
git/python-lefthandclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/hpe-storage/python-lefthandclient
|
1
git/python-magnumclient.txt
Normal file
1
git/python-magnumclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-magnumclient
|
1
git/python-muranoclient.txt
Normal file
1
git/python-muranoclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-muranoclient
|
1
git/python-neutronclient.txt
Normal file
1
git/python-neutronclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-neutronclient
|
1
git/python-novaclient.txt
Normal file
1
git/python-novaclient.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-novaclient
|
1
git/python-openstacksdk.txt
Normal file
1
git/python-openstacksdk.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/openstack/python-openstacksdk
|
1
git/qemu.txt
Normal file
1
git/qemu.txt
Normal file
@ -0,0 +1 @@
|
||||
git.qemu.org/qemu
|
1
git/rpm.txt
Normal file
1
git/rpm.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/rpm-software-management/rpm
|
1
git/ryu.txt
Normal file
1
git/ryu.txt
Normal file
@ -0,0 +1 @@
|
||||
github.com/osrg/ryu
|
1
git/seabios.txt
Normal file
1
git/seabios.txt
Normal file
@ -0,0 +1 @@
|
||||
git.seabios.org/seabios
|
202
middleware/branding/recipes-control/wrs-branding/LICENSE
Normal file
202
middleware/branding/recipes-control/wrs-branding/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
2
middleware/branding/recipes-control/wrs-branding/centos/build_srpm.data
Executable file
2
middleware/branding/recipes-control/wrs-branding/centos/build_srpm.data
Executable file
@ -0,0 +1,2 @@
|
||||
SRC_DIR="sources"
|
||||
TIS_PATCH_VER=6
|
28
middleware/branding/recipes-control/wrs-branding/centos/wrs-branding.spec
Executable file
28
middleware/branding/recipes-control/wrs-branding/centos/wrs-branding.spec
Executable file
@ -0,0 +1,28 @@
|
||||
Summary: Titanium Cloud Branding Information
|
||||
Name: wrs-branding
|
||||
Version: 4.0.0
|
||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
||||
License: Apache-2.0
|
||||
Group: base
|
||||
Packager: Wind River <info@windriver.com>
|
||||
URL: unknown
|
||||
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
%define cgcs_sdk_deploy_dir /opt/deploy/cgcs_sdk
|
||||
|
||||
%description
|
||||
Titanium Cloud Branding allows alternate branding to be used for Horizon
|
||||
in place of the default included with Titanium Cloud.
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/%{cgcs_sdk_deploy_dir}
|
||||
install -m 644 %{SOURCE0} $RPM_BUILD_ROOT/%{cgcs_sdk_deploy_dir}/%{name}-%{version}.tgz
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{cgcs_sdk_deploy_dir}
|
202
middleware/branding/recipes-control/wrs-branding/sources/LICENSE
Normal file
202
middleware/branding/recipes-control/wrs-branding/sources/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
74
middleware/branding/recipes-control/wrs-branding/sources/horizon/README
Executable file
74
middleware/branding/recipes-control/wrs-branding/sources/horizon/README
Executable file
@ -0,0 +1,74 @@
|
||||
Copyright © 2014-2017 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
||||
Titanium Cloud Custom Branding
|
||||
-------------------------------
|
||||
|
||||
Custom branding for the Titanium Cloud is achieved through the creation and application
|
||||
of a tarball containing a customized horizon theme and associated branding files
|
||||
|
||||
|
||||
Creating a Custom Branding Tarball
|
||||
----------------------------------
|
||||
|
||||
The tarball containing the customized branding files must be of the extension .tgz; its
|
||||
file name has no constraints. 'sample_branding.tgz' has been included as an example of
|
||||
the end result. Please note that branding tarballs created for previous releases of
|
||||
Titanium Cloud are not forward-compatible, and must be recreated to accommodate the
|
||||
latest branding styles present in Horizon. An example of how to compress an existing
|
||||
theme would be to do the following from inside the branding's root directory:
|
||||
tar czf new_branding.tgz *
|
||||
|
||||
Two types of items are required in the branding tarball:
|
||||
1) The contents of a valid horizon theme directory as documented here:
|
||||
docs.openstack.org/developer/horizon/topics/customizing.html
|
||||
i.e. in the top level of the tarball are the theme folders 'static' and 'templates' (if used).
|
||||
Both the default and material themes included with horizon are available to be
|
||||
inherited from if desired. Note that when referencing assets included in the custom theme,
|
||||
the theme name will be 'custom'.
|
||||
|
||||
To base the new theme off of the standard titanium cloud theme, or to view an example
|
||||
of how the tarball should be formatted, refer to the example tarball named
|
||||
sample_branding.tgz included with this SDK.
|
||||
|
||||
2) Also in the top level of the tarball, a file named manifest.py which is used to overwrite the default
|
||||
horizon settings used by Titanium Cloud. A description of its contents are as follows:
|
||||
|
||||
SITE_BRANDING is the name that will be used in the site title, note that there are
|
||||
other occurrences of the branding name that must be changed directly in the templates,
|
||||
|
||||
HORIZON_CONFIG["help_url"] is the link that the help button will redirect
|
||||
users to, note that the knowledge library url must also be changed directly in
|
||||
the template,
|
||||
|
||||
Sample entries for these variables are shown below:
|
||||
|
||||
SITE_BRANDING = "Sample System Name"
|
||||
HORIZON_CONFIG["help_url"] = "http://www.windriver.com/support/"
|
||||
|
||||
|
||||
Applying a Custom Branding Tarball
|
||||
----------------------------------
|
||||
|
||||
This branding tarball can be applied at various stages, the steps for each stage are
|
||||
described below:
|
||||
|
||||
1) Before running config_controller
|
||||
i) Copy the branding tarball to the /opt/branding directory, once config_controller
|
||||
is run this branding will be automatically used by horizon
|
||||
|
||||
2) After running config_controller
|
||||
i) If a previous branding tarball was already in use,
|
||||
delete it from /opt/branding,
|
||||
ii) Copy the new branding tarball to the /opt/branding directory on the
|
||||
active controller,
|
||||
iii) Execute the command
|
||||
sudo service horizon restart
|
||||
this will process the new branding files on the active controller,
|
||||
iv) Lock the inactive controller,
|
||||
v) Unlock the inactive controller.
|
||||
lock and unlock can coincide with login banner customization, see
|
||||
also README.banner
|
Binary file not shown.
132
middleware/branding/recipes-control/wrs-branding/sources/login-banner/README
Executable file
132
middleware/branding/recipes-control/wrs-branding/sources/login-banner/README
Executable file
@ -0,0 +1,132 @@
|
||||
Copyright (c) 2016 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Titanium Cloud Customization of Login Banner Files
|
||||
---------------------------------------------------
|
||||
|
||||
This feature permits the customization of prelogin message (issue) and
|
||||
postlogin message of the day (motd) across the entire Titanium Cloud
|
||||
cluster. It is a convenience feature that simplifies propagation of
|
||||
the customized files.
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
See also 'man issue' and 'man motd'.
|
||||
|
||||
The following files can be customized, and are treated by this feature:
|
||||
/etc/issue (login banner, console)
|
||||
/etc/issue.net (login banner, ssh)
|
||||
/etc/motd.head (message of the day, header)
|
||||
/etc/motd.tail (message of the day, footer)
|
||||
|
||||
The following files are not customizable, because each is generated by
|
||||
software:
|
||||
/etc/motd
|
||||
/etc/sysinv/motd.system
|
||||
/etc/platform/motd.license
|
||||
|
||||
issue and issue.net are free standing files, while /etc/motd is
|
||||
generated from the following sources, in the following order:
|
||||
/etc/motd.head
|
||||
/etc/sysinv/motd.system
|
||||
/etc/platform/motd.license
|
||||
/etc/motd.tail
|
||||
|
||||
The customization procedure during Titanium Cloud Installation and
|
||||
Commissioning is summarized as follows:
|
||||
1) provide customization files
|
||||
2) run 'config_controller'
|
||||
|
||||
The customization procedure after config_controller is summarized
|
||||
as follows:
|
||||
3) provide customization files
|
||||
4) run 'apply_banner_customization'
|
||||
5) lock/unlock each node
|
||||
|
||||
Example tarball
|
||||
---------------
|
||||
|
||||
sample_banner.tgz has been provided (adjacent to this README).
|
||||
Extract the tarball on the active controller to the directory
|
||||
/opt/banner, or as indicated in the following sections.
|
||||
|
||||
The tarball contains examples of the four customizable login banner files.
|
||||
|
||||
Procedure prior to config_controller
|
||||
------------------------------------
|
||||
|
||||
When setting up a new cluster, immediately after the first controller
|
||||
boots and before running config_controller:
|
||||
|
||||
1) Provide customization files
|
||||
|
||||
To customize any of the four customizable banner files listed above,
|
||||
provide the new files in the following location:
|
||||
/opt/banner/issue
|
||||
/opt/banner/issue.net
|
||||
/opt/banner/motd.head
|
||||
/opt/banner/motd.tail
|
||||
|
||||
I.e.,
|
||||
sudo mkdir -p /opt/banner
|
||||
sudo tar xf sample_banner.tgz -C /opt/banner
|
||||
|
||||
Each file is customized individually; Edit or remove these files in
|
||||
/opt/banner according to requirements.
|
||||
|
||||
2) Run config_controller
|
||||
|
||||
When config_controller is run these files are moved from /opt/banner
|
||||
to configuration storage and are applied to the controller node as it is
|
||||
initialized. All nodes in the cluster which are subsequently configured
|
||||
will retrieve these custom banners as well.
|
||||
|
||||
Note:
|
||||
In the event that an error is reported for the banner customization,
|
||||
customization can be repeated after config_controller using the
|
||||
following 'Procedure after deployment'; errors for customization do not
|
||||
impact config_controller.
|
||||
|
||||
Procedure after deployment
|
||||
--------------------------
|
||||
Customization can be performed any time after deployment:
|
||||
|
||||
1) Login to the active controller
|
||||
2) Switch to root user, i.e., 'sudo bash'
|
||||
3) Provide any of the customized banner files in /opt/banner, or another
|
||||
directory:
|
||||
/opt/banner/issue
|
||||
/opt/banner/issue.net
|
||||
/opt/banner/motd.head
|
||||
/opt/banner/motd.tail
|
||||
4) Apply the customization, execute:
|
||||
'apply_banner_customization /opt/banner', or
|
||||
'apply_banner_customization <your path>'
|
||||
|
||||
The default path, if no parameter is specified, is the current
|
||||
working directory, i.e.,
|
||||
'apply_banner_customization $(pwd)'
|
||||
|
||||
The banners are applied to configuration and installed on the
|
||||
current node, active controller.
|
||||
|
||||
5) Lock and unlock other nodes in the cluster, either from the CLI or
|
||||
the GUI, to install the customization on each node. Lock and unlock
|
||||
can coincide with horizon branding procedure; see also adjacent
|
||||
../horizon/README for horizon branding.
|
||||
|
||||
All subsequent newly added nodes will automatically get the banner
|
||||
customization.
|
||||
|
||||
Manual Restoration
|
||||
------------------
|
||||
|
||||
Replaced versions of banner files can be retrieved at the user's
|
||||
discretion from each node in the cluster, from the directory:
|
||||
/opt/banner.bk
|
||||
|
||||
A maximum of 10 versions of each file are maintained, with the oldest
|
||||
versions replaced only when the count reaches 10.
|
Binary file not shown.
6
middleware/filesystem/recipes-common/logmgmt/.gitignore
vendored
Normal file
6
middleware/filesystem/recipes-common/logmgmt/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
!.distro
|
||||
.distro/centos7/rpmbuild/RPMS
|
||||
.distro/centos7/rpmbuild/SRPMS
|
||||
.distro/centos7/rpmbuild/BUILD
|
||||
.distro/centos7/rpmbuild/BUILDROOT
|
||||
.distro/centos7/rpmbuild/SOURCES/logmgmt*tar.gz
|
202
middleware/filesystem/recipes-common/logmgmt/LICENSE
Normal file
202
middleware/filesystem/recipes-common/logmgmt/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
13
middleware/filesystem/recipes-common/logmgmt/PKG-INFO
Normal file
13
middleware/filesystem/recipes-common/logmgmt/PKG-INFO
Normal file
@ -0,0 +1,13 @@
|
||||
Metadata-Version: 1.1
|
||||
Name: logmgmt
|
||||
Version: 1.0
|
||||
Summary: Management of /var/log filesystem
|
||||
Home-page:
|
||||
Author: Windriver
|
||||
Author-email: info@windriver.com
|
||||
License: Apache-2.0
|
||||
|
||||
Description: Management of /var/log filesystem
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
@ -0,0 +1,4 @@
|
||||
SRC_DIR="logmgmt"
|
||||
COPY_LIST_TO_TAR="scripts"
|
||||
COPY_LIST="$SRC_DIR/LICENSE"
|
||||
TIS_PATCH_VER=4
|
@ -0,0 +1,73 @@
|
||||
Summary: Management of /var/log filesystem
|
||||
Name: logmgmt
|
||||
Version: 1.0
|
||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
||||
License: Apache-2.0
|
||||
Group: base
|
||||
Packager: Wind River <info@windriver.com>
|
||||
URL: unknown
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: LICENSE
|
||||
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: systemd-devel
|
||||
Requires: systemd
|
||||
Requires: python-daemon
|
||||
|
||||
%description
|
||||
Management of /var/log filesystem
|
||||
|
||||
%define local_bindir /usr/bin/
|
||||
%define local_etc_initd /etc/init.d/
|
||||
%define local_etc_pmond /etc/pmon.d/
|
||||
%define pythonroot /usr/lib64/python2.7/site-packages
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
# Remove bundled egg-info
|
||||
rm -rf *.egg-info
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
|
||||
%install
|
||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
|
||||
--install-lib=%{pythonroot} \
|
||||
--prefix=/usr \
|
||||
--install-data=/usr/share \
|
||||
--single-version-externally-managed
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_bindir}
|
||||
install -p -D -m 700 scripts/bin/logmgmt %{buildroot}%{local_bindir}/logmgmt
|
||||
install -p -D -m 700 scripts/bin/logmgmt_postrotate %{buildroot}%{local_bindir}/logmgmt_postrotate
|
||||
install -p -D -m 700 scripts/bin/logmgmt_prerotate %{buildroot}%{local_bindir}/logmgmt_prerotate
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_initd}
|
||||
install -p -D -m 700 scripts/init.d/logmgmt %{buildroot}%{local_etc_initd}/logmgmt
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_pmond}
|
||||
install -p -D -m 644 scripts/pmon.d/logmgmt %{buildroot}%{local_etc_pmond}/logmgmt
|
||||
|
||||
install -p -D -m 664 scripts/etc/systemd/system/logmgmt.service %{buildroot}%{_unitdir}/logmgmt.service
|
||||
|
||||
%post
|
||||
/usr/bin/systemctl enable logmgmt.service >/dev/null 2>&1
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE
|
||||
%{local_bindir}/*
|
||||
%{local_etc_initd}/*
|
||||
%dir %{local_etc_pmond}
|
||||
%{local_etc_pmond}/*
|
||||
%{_unitdir}/logmgmt.service
|
||||
%dir %{pythonroot}/%{name}
|
||||
%{pythonroot}/%{name}/*
|
||||
%dir %{pythonroot}/%{name}-%{version}.0-py2.7.egg-info
|
||||
%{pythonroot}/%{name}-%{version}.0-py2.7.egg-info/*
|
202
middleware/filesystem/recipes-common/logmgmt/logmgmt/LICENSE
Normal file
202
middleware/filesystem/recipes-common/logmgmt/logmgmt/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,6 @@
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
@ -0,0 +1,263 @@
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
###################
|
||||
# IMPORTS
|
||||
###################
|
||||
import logging
|
||||
import logging.handlers
|
||||
import time
|
||||
import os
|
||||
import subprocess
|
||||
import glob
|
||||
import re
|
||||
import sys
|
||||
|
||||
from daemon import runner
|
||||
|
||||
import prepostrotate
|
||||
|
||||
###################
|
||||
# CONSTANTS
|
||||
###################
|
||||
LOG_DIR = '/var/lib/logmgmt'
|
||||
LOG_FILE = LOG_DIR + '/logmgmt.log'
|
||||
PID_FILE = '/var/run/logmgmt.pid'
|
||||
LOG_FILE_MAX_BYTES = 1024*1024
|
||||
LOG_FILE_BACKUP_COUNT = 5
|
||||
|
||||
PERCENT_FREE_CRITICAL = 10
|
||||
PERCENT_FREE_MAJOR = 20
|
||||
|
||||
LOGROTATE_PERIOD = 600 # Every ten minutes
|
||||
|
||||
###################
|
||||
# METHODS
|
||||
###################
|
||||
def start_polling():
|
||||
logmgmt_daemon = LogMgmtDaemon()
|
||||
logmgmt_runner = runner.DaemonRunner(logmgmt_daemon)
|
||||
logmgmt_runner.daemon_context.umask = 0o022
|
||||
logmgmt_runner.do_action()
|
||||
|
||||
def handle_exception(exc_type, exc_value, exc_traceback):
|
||||
"""
|
||||
Exception handler to log any uncaught exceptions
|
||||
"""
|
||||
logging.error("Uncaught exception",
|
||||
exc_info=(exc_type, exc_value, exc_traceback))
|
||||
sys.__excepthook__(exc_type, exc_value, exc_traceback)
|
||||
|
||||
|
||||
###################
|
||||
# CLASSES
|
||||
###################
|
||||
class LogMgmtDaemon():
|
||||
""" Daemon process representation of
|
||||
the /var/log monitoring program
|
||||
"""
|
||||
def __init__(self):
|
||||
# Daemon-specific init
|
||||
self.stdin_path = '/dev/null'
|
||||
self.stdout_path = '/dev/null'
|
||||
self.stderr_path = '/dev/null'
|
||||
self.pidfile_path = PID_FILE
|
||||
self.pidfile_timeout = 5
|
||||
|
||||
self.monitored_files = []
|
||||
self.unmonitored_files = []
|
||||
|
||||
self.last_logrotate = 0
|
||||
self.last_check = 0
|
||||
|
||||
def configure_logging(self, level=logging.DEBUG):
|
||||
my_exec = os.path.basename(sys.argv[0])
|
||||
|
||||
if not os.path.exists(LOG_DIR):
|
||||
os.mkdir(LOG_DIR, 0755)
|
||||
|
||||
log_format = '%(asctime)s: ' \
|
||||
+ my_exec + '[%(process)s]: ' \
|
||||
+ '%(filename)s(%(lineno)s): ' \
|
||||
+ '%(levelname)s: %(message)s'
|
||||
|
||||
fmt = logging.Formatter(fmt=log_format)
|
||||
|
||||
# Use python's log rotation, rather than logrotate
|
||||
handler = logging.handlers.RotatingFileHandler(
|
||||
LOG_FILE,
|
||||
maxBytes=LOG_FILE_MAX_BYTES,
|
||||
backupCount=LOG_FILE_BACKUP_COUNT)
|
||||
|
||||
my_logger = logging.getLogger()
|
||||
my_logger.setLevel(level)
|
||||
|
||||
handler.setFormatter(fmt)
|
||||
handler.setLevel(level)
|
||||
my_logger.addHandler(handler)
|
||||
|
||||
# Log uncaught exceptions to file
|
||||
sys.excepthook = handle_exception
|
||||
|
||||
def run(self):
|
||||
self.configure_logging()
|
||||
|
||||
while True:
|
||||
self.check_var_log()
|
||||
|
||||
# run/poll every 1 min
|
||||
time.sleep(60)
|
||||
|
||||
def get_percent_free(self):
|
||||
usage = os.statvfs('/var/log')
|
||||
return ((usage.f_bavail * 100) / usage.f_blocks)
|
||||
|
||||
def get_monitored_files(self):
|
||||
self.monitored_files = []
|
||||
|
||||
try:
|
||||
output = subprocess.check_output(['/usr/sbin/logrotate', '-d', '/etc/logrotate.conf'],
|
||||
stderr=subprocess.STDOUT)
|
||||
|
||||
for line in output.split('\n'):
|
||||
fields = line.split()
|
||||
if len(fields) > 0 and fields[0] == "considering":
|
||||
self.monitored_files.extend(glob.glob(fields[2]))
|
||||
self.monitored_files.extend(glob.glob(fields[2] + '.[0-9].gz'))
|
||||
self.monitored_files.extend(glob.glob(fields[2] + '.[0-9][0-9].gz'))
|
||||
except:
|
||||
logging.error('Failed to determine monitored files')
|
||||
|
||||
def get_unmonitored_files(self):
|
||||
self.unmonitored_files = []
|
||||
|
||||
try:
|
||||
output = subprocess.check_output(['find', '/var/log', '-type', 'f'])
|
||||
|
||||
for fname in output.split('\n'):
|
||||
if fname in self.monitored_files:
|
||||
continue
|
||||
|
||||
# Ignore some files
|
||||
if '/var/log/puppet' in fname \
|
||||
or '/var/log/dmesg' in fname \
|
||||
or '/var/log/rabbitmq' in fname \
|
||||
or '/var/log/lastlog' in fname:
|
||||
continue
|
||||
|
||||
if os.path.exists(fname):
|
||||
self.unmonitored_files.append(fname)
|
||||
|
||||
except:
|
||||
logging.error('Failed to determine unmonitored files')
|
||||
|
||||
def purge_files(self, index):
|
||||
pattern = re.compile('.*\.([0-9]*)\.gz')
|
||||
for fname in sorted(self.monitored_files):
|
||||
result = pattern.match(fname)
|
||||
if result:
|
||||
if int(result.group(1)) >= index:
|
||||
logging.info("Purging file: %s" % fname)
|
||||
try:
|
||||
os.remove(fname)
|
||||
except OSError as e:
|
||||
logging.error('Failed to remove file: %s', e)
|
||||
|
||||
def run_logrotate(self):
|
||||
self.last_logrotate = int(time.time())
|
||||
try:
|
||||
subprocess.check_call(['/usr/sbin/logrotate', '/etc/logrotate.conf'])
|
||||
except:
|
||||
logging.error('Failed logrotate')
|
||||
|
||||
def run_logrotate_forced(self):
|
||||
self.last_logrotate = int(time.time())
|
||||
try:
|
||||
subprocess.check_call(['/usr/sbin/logrotate', '-f', '/etc/logrotate.conf'])
|
||||
except:
|
||||
logging.error('Failed logrotate -f')
|
||||
|
||||
def timecheck(self):
|
||||
# If we're more than a couple of mins since the last timecheck,
|
||||
# there could have been a large time correction, which would skew
|
||||
# our timing. Reset the logrotate timestamp to ensure we don't miss anything
|
||||
now = int(time.time())
|
||||
|
||||
if self.last_check > now or (now - self.last_check) > 120:
|
||||
self.last_logrotate = 0
|
||||
|
||||
self.last_check = now
|
||||
|
||||
def check_var_log(self):
|
||||
self.timecheck()
|
||||
|
||||
try:
|
||||
prepostrotate.ensure_bash_log_locked_down()
|
||||
except Exception as e:
|
||||
logging.exception('Failed to ensure bash.log locked', e)
|
||||
|
||||
pf = self.get_percent_free()
|
||||
|
||||
if pf > PERCENT_FREE_CRITICAL:
|
||||
# We've got more than 10% free space, so just run logrotate every ten minutes
|
||||
now = int(time.time())
|
||||
if self.last_logrotate > now or (now - self.last_logrotate) > LOGROTATE_PERIOD:
|
||||
logging.info("Running logrotate")
|
||||
self.run_logrotate()
|
||||
|
||||
return
|
||||
|
||||
logging.warning("Reached critical disk usage for /var/log: %d%% free" % pf)
|
||||
|
||||
# We're running out of disk space, so we need to start deleting files
|
||||
for index in range(20, 11, -1):
|
||||
logging.info("/var/log is %d%% free. Purging rotated .%d.gz files to free space" % (pf, index))
|
||||
self.get_monitored_files()
|
||||
self.purge_files(index)
|
||||
pf = self.get_percent_free()
|
||||
|
||||
if pf >= PERCENT_FREE_MAJOR:
|
||||
# We've freed up enough space. Do a logrotate and leave
|
||||
logging.info("/var/log is %d%% free. Running logrotate" % pf)
|
||||
self.run_logrotate()
|
||||
return
|
||||
|
||||
# We still haven't freed up enough space, so try a logrotate
|
||||
logging.info("/var/log is %d%% free. Running logrotate" % pf)
|
||||
self.run_logrotate()
|
||||
|
||||
pf = self.get_percent_free()
|
||||
if pf >= PERCENT_FREE_MAJOR:
|
||||
return
|
||||
|
||||
# Try a forced rotate
|
||||
logging.info("/var/log is %d%% free. Running forced logrotate" % pf)
|
||||
self.run_logrotate_forced()
|
||||
|
||||
pf = self.get_percent_free()
|
||||
if pf >= PERCENT_FREE_MAJOR:
|
||||
return
|
||||
|
||||
# Start deleting unmonitored files
|
||||
self.get_monitored_files()
|
||||
self.get_unmonitored_files()
|
||||
logging.info("/var/log is %d%% free. Deleting unmonitored files to free space" % pf)
|
||||
for fname in sorted(self.unmonitored_files, key=os.path.getsize, reverse=True):
|
||||
logging.info("Deleting unmonitored file: %s" % fname)
|
||||
try:
|
||||
os.remove(fname)
|
||||
except OSError as e:
|
||||
logging.error('Failed to remove file: %s', e)
|
||||
pf = self.get_percent_free()
|
||||
if pf >= PERCENT_FREE_MAJOR:
|
||||
logging.info("/var/log is %d%% free." % pf)
|
||||
return
|
||||
|
||||
# Nothing else to be done
|
||||
logging.info("/var/log is %d%% free." % pf)
|
||||
return
|
||||
|
@ -0,0 +1,60 @@
|
||||
"""
|
||||
Copyright (c) 2017 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
###################
|
||||
# IMPORTS
|
||||
###################
|
||||
|
||||
import array
|
||||
import fcntl
|
||||
import struct
|
||||
import glob
|
||||
|
||||
EXT2_APPEND_FL = 0x00000020
|
||||
EXT4_EXTENTS_FL = 0x00080000
|
||||
|
||||
EXT_IOC_SETFLAGS = 0x40086602
|
||||
EXT_IOC_GETFLAGS = 0x80086601
|
||||
|
||||
|
||||
def _is_file_append_only(filename):
|
||||
buf = array.array('h', [0])
|
||||
with open(filename, 'r') as f:
|
||||
fcntl.ioctl(f.fileno(), EXT_IOC_GETFLAGS, buf)
|
||||
has_append_only = (buf.tolist()[0] & EXT2_APPEND_FL) == EXT2_APPEND_FL
|
||||
return has_append_only
|
||||
|
||||
|
||||
def _set_file_attrs(filename, attrs):
|
||||
flags = struct.pack('i', attrs)
|
||||
with open(filename, 'r') as f:
|
||||
fcntl.ioctl(f.fileno(), EXT_IOC_SETFLAGS, flags)
|
||||
|
||||
|
||||
def chattr_add_append_only(filename):
|
||||
_set_file_attrs(filename, EXT2_APPEND_FL | EXT4_EXTENTS_FL)
|
||||
|
||||
|
||||
def chattr_remove_append_only(filename):
|
||||
_set_file_attrs(filename, EXT4_EXTENTS_FL)
|
||||
|
||||
|
||||
def prerotate():
|
||||
for filename in glob.glob("/var/log/bash.log*"):
|
||||
if _is_file_append_only(filename):
|
||||
chattr_remove_append_only(filename)
|
||||
|
||||
|
||||
def postrotate():
|
||||
for filename in glob.glob("/var/log/bash.log*"):
|
||||
if not _is_file_append_only(filename):
|
||||
chattr_add_append_only(filename)
|
||||
|
||||
|
||||
def ensure_bash_log_locked_down():
|
||||
# need the same functionality as postrotate
|
||||
postrotate()
|
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(name='logmgmt',
|
||||
version='1.0.0',
|
||||
description='logmgmt',
|
||||
license='Apache-2.0',
|
||||
packages=['logmgmt'],
|
||||
entry_points={
|
||||
}
|
||||
)
|
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
from logmgmt import logmgmt
|
||||
except EnvironmentError as e:
|
||||
print >> sys.stderr, "Error importing logmgmt: ", str(e)
|
||||
sys.exit(1)
|
||||
|
||||
logmgmt.start_polling()
|
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
from logmgmt import prepostrotate
|
||||
except EnvironmentError as e:
|
||||
print >> sys.stderr, "Error importing prepostrotate: ", str(e)
|
||||
sys.exit(1)
|
||||
|
||||
prepostrotate.postrotate()
|
||||
|
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2014 Wind River Systems, Inc.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
from logmgmt import prepostrotate
|
||||
except EnvironmentError as e:
|
||||
print >> sys.stderr, "Error importing prepostrotate: ", str(e)
|
||||
sys.exit(1)
|
||||
|
||||
prepostrotate.prerotate()
|
||||
|
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Titanium Cloud Log Management
|
||||
After=network.target syslog-ng.service iscsid.service sw-patch.service
|
||||
Before=config.service pmon.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/etc/init.d/logmgmt start
|
||||
ExecStop=/etc/init.d/logmgmt stop
|
||||
ExecReload=/etc/init.d/logmgmt restart
|
||||
PIDFile=/var/run/logmgmt.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: logmgmt
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Daemon for /var/log management
|
||||
# Description: Daemon for /var/log management
|
||||
### END INIT INFO
|
||||
|
||||
DESC="logmgmt"
|
||||
DAEMON="/usr/bin/logmgmt"
|
||||
RUNDIR="/var/run"
|
||||
PIDFILE=$RUNDIR/$DESC.pid
|
||||
|
||||
start()
|
||||
{
|
||||
if [ -e $PIDFILE ]; then
|
||||
PIDDIR=/prod/$(cat $PIDFILE)
|
||||
if [ -d ${PIDFILE} ]; then
|
||||
echo "$DESC already running."
|
||||
exit 0
|
||||
else
|
||||
echo "Removing stale PID file $PIDFILE"
|
||||
rm -f $PIDFILE
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "Starting $DESC..."
|
||||
mkdir -p $RUNDIR
|
||||
start-stop-daemon --start --quiet \
|
||||
--pidfile ${PIDFILE} --exec ${DAEMON} start
|
||||
|
||||
#--make-pidfile
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "done."
|
||||
else
|
||||
echo "failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
echo -n "Stopping $DESC..."
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "done."
|
||||
else
|
||||
echo "failed."
|
||||
fi
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
status()
|
||||
{
|
||||
pid=`cat $PIDFILE 2>/dev/null`
|
||||
if [ -n "$pid" ]; then
|
||||
if ps -p $pid &>/dev/null ; then
|
||||
echo "$DESC is running"
|
||||
exit 0
|
||||
else
|
||||
echo "$DESC is not running but has pid file"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "$DESC is not running"
|
||||
exit 3
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|force-reload|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|force-reload|restart|reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -0,0 +1,24 @@
|
||||
;
|
||||
; Copyright (c) 2014-2016 Wind River Systems, Inc.
|
||||
;
|
||||
; SPDX-License-Identifier: Apache-2.0
|
||||
;
|
||||
[process]
|
||||
process = logmgmt
|
||||
pidfile = /var/run/logmgmt.pid
|
||||
script = /etc/init.d/logmgmt
|
||||
style = lsb ; ocf or lsb
|
||||
severity = minor ; Process failure severity
|
||||
; critical : host is failed
|
||||
; major : host is degraded
|
||||
; minor : log is generated
|
||||
restarts = 5 ; Number of back to back unsuccessful restarts before severity assertion
|
||||
interval = 10 ; Number of seconds to wait between back-to-back unsuccessful restarts
|
||||
debounce = 20 ; Number of seconds the process needs to run before declaring
|
||||
; it as running O.K. after a restart.
|
||||
; Time after which back-to-back restart count is cleared.
|
||||
startuptime = 10 ; Seconds to wait after process start before starting the debounce monitor
|
||||
mode = passive ; Monitoring mode: passive (default) or active
|
||||
; passive: process death monitoring (default: always)
|
||||
; active: heartbeat monitoring, i.e. request / response messaging
|
||||
|
6
middleware/filesystem/recipes-control/filesystem-scripts/.gitignore
vendored
Normal file
6
middleware/filesystem/recipes-control/filesystem-scripts/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
!.distro
|
||||
.distro/centos7/rpmbuild/RPMS
|
||||
.distro/centos7/rpmbuild/SRPMS
|
||||
.distro/centos7/rpmbuild/BUILD
|
||||
.distro/centos7/rpmbuild/BUILDROOT
|
||||
.distro/centos7/rpmbuild/SOURCES/filesystem-scripts*tar.gz
|
202
middleware/filesystem/recipes-control/filesystem-scripts/LICENSE
Normal file
202
middleware/filesystem/recipes-control/filesystem-scripts/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,13 @@
|
||||
Metadata-Version: 1.1
|
||||
Name: filesystem-scripts
|
||||
Version: 1.0
|
||||
Summary: File System Script Package
|
||||
Home-page:
|
||||
Author: Windriver
|
||||
Author-email: info@windriver.com
|
||||
License: Apache-2.0
|
||||
|
||||
Description: File System Script Package
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
@ -0,0 +1,3 @@
|
||||
SRC_DIR="filesystem-scripts-1.0"
|
||||
COPY_LIST="$PKG_BASE/LICENSE"
|
||||
TIS_PATCH_VER=2
|
@ -0,0 +1,56 @@
|
||||
Summary: File System Script Package
|
||||
Name: filesystem-scripts
|
||||
Version: 1.0
|
||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
||||
License: Apache-2.0
|
||||
Group: base
|
||||
Packager: Wind River <info@windriver.com>
|
||||
URL: unknown
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: LICENSE
|
||||
|
||||
BuildRequires: systemd-devel
|
||||
Requires: /bin/systemctl
|
||||
|
||||
%description
|
||||
File System Script Package
|
||||
|
||||
%define local_bindir /usr/bin/
|
||||
%define local_etc_initd /etc/init.d/
|
||||
%define local_ocfdir /usr/lib/ocf/resource.d/platform/
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_initd}
|
||||
install -p -D -m 755 uexportfs %{buildroot}%{local_etc_initd}/uexportfs
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_ocfdir}
|
||||
install -p -D -m 755 nfsserver-mgmt %{buildroot}%{local_ocfdir}/nfsserver-mgmt
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_bindir}
|
||||
install -p -D -m 755 nfs-mount %{buildroot}%{local_bindir}/nfs-mount
|
||||
|
||||
install -p -D -m 644 uexportfs.service %{buildroot}%{_unitdir}/uexportfs.service
|
||||
|
||||
%post
|
||||
/bin/systemctl enable uexportfs.service
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%defattr(-,root,root,-)
|
||||
%{local_bindir}/*
|
||||
%{local_etc_initd}/*
|
||||
%dir %{local_ocfdir}
|
||||
%{local_ocfdir}/*
|
||||
%{_unitdir}/uexportfs.service
|
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
#
|
||||
# This utility is a wrapper around mount, to provide a single script
|
||||
# with preferred options for NFS mounting. It takes exactly two arguments:
|
||||
# - network source path
|
||||
# - local destination path
|
||||
#
|
||||
|
||||
function show_help()
|
||||
{
|
||||
cat >&2 << EOF
|
||||
$(basename $0):
|
||||
Wrapper around "mount" to provide a set of default options for NFS mounts.
|
||||
This utility takes exactly two arguments:
|
||||
- network source path
|
||||
- local destination path
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
function get_proto()
|
||||
{
|
||||
local host=$1
|
||||
|
||||
# Check /etc/hosts for the hostname
|
||||
local ipaddr=$(cat /etc/hosts | awk -v host=$host '$2 == host {print $1}')
|
||||
if [[ "$ipaddr" =~ ^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$ ]]
|
||||
then
|
||||
echo "udp"
|
||||
return
|
||||
fi
|
||||
if [[ "$ipaddr" =~ ^[0-9a-z]*\:[0-9a-z\:]*$ ]]
|
||||
then
|
||||
echo "udp6"
|
||||
return
|
||||
fi
|
||||
# Try the DNS query
|
||||
ipaddr=$(dig +short ANY $host)
|
||||
if [[ "$ipaddr" =~ ^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$ ]]
|
||||
then
|
||||
echo "udp"
|
||||
return
|
||||
fi
|
||||
if [[ "$ipaddr" =~ ^[0-9a-z]*\:[0-9a-z\:]*$ ]]
|
||||
then
|
||||
echo "udp6"
|
||||
return
|
||||
fi
|
||||
|
||||
# Use default of udp to avoid invalid option
|
||||
echo "udp"
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if [[ ${BASH_ARGC[0]} != 2 ]]
|
||||
then
|
||||
show_help
|
||||
fi
|
||||
|
||||
if mountpoint -q $2
|
||||
then
|
||||
echo "$2 is already mounted. Not mounting."
|
||||
exit
|
||||
fi
|
||||
|
||||
HOST=`echo $1|awk -F ':' '{print $1}'`
|
||||
declare proto=`get_proto $HOST`
|
||||
declare -i timeo=30
|
||||
declare -i rw_size=1024
|
||||
declare DEFAULT_OPTS="timeo=$timeo,proto=$proto,vers=3,rsize=$rw_size,wsize=$rw_size"
|
||||
|
||||
exec mount -t nfs -o $DEFAULT_OPTS $1 $2
|
||||
|
@ -0,0 +1,307 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
#
|
||||
# Support: www.windriver.com
|
||||
#
|
||||
# Purpose: This resource agent manages File System Service
|
||||
#
|
||||
# RA Spec:
|
||||
#
|
||||
# http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/resource-agent-api.txt?rev=HEAD
|
||||
#
|
||||
#######################################################################
|
||||
# Initialization:
|
||||
|
||||
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
|
||||
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
|
||||
|
||||
#######################################################################
|
||||
|
||||
#######################################################################
|
||||
|
||||
usage() {
|
||||
cat <<UEND
|
||||
|
||||
usage: $0 (start|stop|status|reload|monitor|validate-all|meta-data)
|
||||
|
||||
$0 manages the File System as an HA resource
|
||||
|
||||
The 'start'...... operation starts the service.
|
||||
The 'stop'....... operation stops the service.
|
||||
The 'reload'..... operation stops and then starts the service.
|
||||
The 'status'..... operation checks the status of the service.
|
||||
The 'monitor'.... operation indicates the in-service status of the service.
|
||||
The 'validate-all' operation reports whether the parameters are valid.
|
||||
The 'meta-data'... operation reports the meta-data information.
|
||||
|
||||
UEND
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
|
||||
meta_data() {
|
||||
|
||||
cat <<END
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
|
||||
<resource-agent name="nfsserver-mgmt">
|
||||
<version>1.0</version>
|
||||
|
||||
<longdesc lang="en">
|
||||
This OCF Compliant Resource Agent makes sure the nfs server is in the
|
||||
correct state.
|
||||
</longdesc>
|
||||
|
||||
<shortdesc lang="en">
|
||||
Makes sure the NFS Server is in the correct state.
|
||||
</shortdesc>
|
||||
|
||||
<parameters>
|
||||
<parameter name="exports" required="1">
|
||||
<longdesc lang="en">List of exports that should not be exported anymore</longdesc>
|
||||
<shortdesc lang="en">List of exports</shortdesc>
|
||||
<content type="string" default=""/>
|
||||
</parameter>
|
||||
|
||||
<parameter name="mounts" required="1">
|
||||
<longdesc lang="en">List of mounts that should not be mounted anymore</longdesc>
|
||||
<shortdesc lang="en">List of mounts</shortdesc>
|
||||
<content type="string" default=""/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
||||
<actions>
|
||||
<action name="start" timeout="10s" />
|
||||
<action name="stop" timeout="130s" />
|
||||
<action name="monitor" timeout="10s" interval="30s" />
|
||||
<action name="meta-data" timeout="10s" />
|
||||
<action name="validate-all" timeout="10s" />
|
||||
</actions>
|
||||
</resource-agent>
|
||||
END
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
nfs_server_mgmt_validate() {
|
||||
check_binary service
|
||||
check_binary grep
|
||||
check_binary cat
|
||||
check_binary exportfs
|
||||
check_binary fuser
|
||||
check_binary mount
|
||||
check_binary umount
|
||||
check_binary logger
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
nfs_server_mgmt_status() {
|
||||
return ${OCF_NOT_RUNNING}
|
||||
}
|
||||
|
||||
nfs_server_mgmt_monitor () {
|
||||
return ${OCF_NOT_RUNNING}
|
||||
}
|
||||
|
||||
check_exportfs () {
|
||||
local CLIENTSPEC_DIR=$1
|
||||
local rc
|
||||
|
||||
OLD_IFS="${IFS}"
|
||||
IFS=":"
|
||||
STR_ARRAY=( $CLIENTSPEC_DIR )
|
||||
IFS="${OLD_IFS}"
|
||||
|
||||
CLIENTSPEC=${STR_ARRAY[0]}
|
||||
DIR=${STR_ARRAY[1]}
|
||||
|
||||
cat /proc/fs/nfsd/exports | grep "${CLIENTSPEC}" | grep "${DIR}" > /dev/null 2>&1
|
||||
rc=$?
|
||||
if [ ${rc} -eq 0 ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
exportfs | grep "${CLIENTSPEC}" | grep "${DIR}" > /dev/null 2>&1
|
||||
rc=$?
|
||||
if [ ${rc} -eq 0 ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
do_nfs_restart () {
|
||||
while true
|
||||
do
|
||||
ocf_log info "NFS Server restart"
|
||||
service nfsserver restart
|
||||
ocf_log info "NFS Server restart complete"
|
||||
|
||||
service nfsserver status | grep stopped > /dev/null 2>&1 || {
|
||||
ocf_log info "NFS Server is now running"
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
ocf_log error "NFS Server still not running"
|
||||
sleep 5
|
||||
done
|
||||
}
|
||||
|
||||
do_umount () {
|
||||
local DEV_DIR=$1
|
||||
|
||||
OLD_IFS="${IFS}"
|
||||
IFS=":"
|
||||
STR_ARRAY=( $DEV_DIR )
|
||||
IFS="${OLD_IFS}"
|
||||
|
||||
DEV=${STR_ARRAY[0]}
|
||||
DIR=${STR_ARRAY[1]}
|
||||
|
||||
mount | grep "${DEV}" | grep "${DIR}" > /dev/null 2>&1 || {
|
||||
ocf_log info "${DEV} ${DIR} not mounted"
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
ocf_log info "umount on ${DEV} ${DIR}"
|
||||
umount ${DEV} ${DIR} > /dev/null 2>&1
|
||||
|
||||
while true
|
||||
do
|
||||
mount | grep "${DEV}" | grep "${DIR}" > /dev/null 2>&1 || {
|
||||
ocf_log info "unmounted ${DEV} ${DIR} successfully"
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
if fuser -KILL -m -k ${DIR}
|
||||
then
|
||||
ocf_log info "Processes killed using ${DEV} ${DIR}"
|
||||
else
|
||||
ocf_log info "No processes using ${DEV} ${DIR}"
|
||||
fi
|
||||
|
||||
ocf_log info "umount force on ${DEV} ${DIR}"
|
||||
umount -f ${DEV} ${DIR} > /dev/null 2>&1
|
||||
|
||||
sleep 2
|
||||
|
||||
mount | grep "${DEV}" | grep "${DIR}" > /dev/null 2>&1 || {
|
||||
ocf_log info "unmounted ${DEV} ${DIR} successfully"
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
do_nfs_restart
|
||||
done
|
||||
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
nfs_server_mgmt_start () {
|
||||
service nfsserver status | grep stopped > /dev/null 2>&1 || {
|
||||
ocf_log info "NFS Server is running"
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
ocf_log error "NFS Server not running, restarting"
|
||||
do_nfs_restart
|
||||
return $?
|
||||
}
|
||||
|
||||
nfs_server_mgmt_stop () {
|
||||
local need_nfs_restart=0
|
||||
local rc
|
||||
|
||||
# Make sure exports are stopped...
|
||||
while IFS=',' read -ra CLIENTSPEC_DIRS
|
||||
do
|
||||
for CLIENTSPEC_DIR in "${CLIENTSPEC_DIRS[@]}"
|
||||
do
|
||||
check_exportfs ${CLIENTSPEC_DIR}
|
||||
rc=$?
|
||||
if [ ${rc} -eq 1 ]
|
||||
then
|
||||
ocf_log info "export ${CLIENTSPEC_DIR} found"
|
||||
let need_nfs_restart=1
|
||||
fi
|
||||
done
|
||||
done <<< "${OCF_RESKEY_exports}"
|
||||
|
||||
if [ ${need_nfs_restart} -ne 0 ]
|
||||
then
|
||||
do_nfs_restart
|
||||
rc=$?
|
||||
if [ ${rc} -ne ${OCF_SUCCESS} ]
|
||||
then
|
||||
return ${rc}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure mounts are not mounted.
|
||||
while IFS=',' read -ra MOUNTS
|
||||
do
|
||||
for MOUNT in "${MOUNTS[@]}"
|
||||
do
|
||||
do_umount ${MOUNT}
|
||||
done
|
||||
done <<< "${OCF_RESKEY_mounts}"
|
||||
|
||||
return ${OCF_SUCCESS}
|
||||
}
|
||||
|
||||
nfs_server_mgmt_reload () {
|
||||
local rc
|
||||
|
||||
nfs_server_mgmt_stop
|
||||
rc=$?
|
||||
if [ $rc -eq ${OCF_SUCCESS} ]
|
||||
then
|
||||
nfs_server_mgmt_start
|
||||
rc=$?
|
||||
if [ $rc -eq ${OCF_SUCCESS} ]
|
||||
then
|
||||
ocf_log info "NFS Server Managment reloaded"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${rc} -ne ${OCF_SUCCESS} ]
|
||||
then
|
||||
ocf_log info "NFS Server Managment reload failed (rc=${rc})"
|
||||
fi
|
||||
|
||||
return ${rc}
|
||||
}
|
||||
|
||||
case ${__OCF_ACTION} in
|
||||
meta-data) meta_data
|
||||
exit ${OCF_SUCCESS}
|
||||
;;
|
||||
usage|help) usage
|
||||
exit ${OCF_SUCCESS}
|
||||
;;
|
||||
esac
|
||||
|
||||
# Anything except meta-data and help must pass validation
|
||||
nfs_server_mgmt_validate || exit $?
|
||||
|
||||
case ${__OCF_ACTION} in
|
||||
start) nfs_server_mgmt_start
|
||||
;;
|
||||
stop) nfs_server_mgmt_stop
|
||||
;;
|
||||
status) nfs_server_mgmt_status
|
||||
;;
|
||||
reload) nfs_server_mgmt_reload
|
||||
;;
|
||||
monitor) nfs_server_mgmt_monitor
|
||||
;;
|
||||
validate-all) nfs_server_mgmt_validate
|
||||
;;
|
||||
*) usage
|
||||
exit ${OCF_ERR_UNIMPLEMENTED}
|
||||
;;
|
||||
esac
|
@ -0,0 +1,19 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: uexportfs
|
||||
# Default-Start: 3
|
||||
# Default-Stop:
|
||||
# Short-Description: Used to remove all exported filesystems on a boot
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
exportfs -r > /dev/null 2>&1
|
||||
|
||||
: exit 0
|
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Titanium Cloud Filesystem Initialization
|
||||
After=network.target nfscommon.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/init.d/uexportfs start
|
||||
ExecStop=/etc/init.d/uexportfs stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
6
middleware/io-monitor/recipes-common/io-monitor/.gitignore
vendored
Normal file
6
middleware/io-monitor/recipes-common/io-monitor/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
!.distro
|
||||
.distro/centos7/rpmbuild/RPMS
|
||||
.distro/centos7/rpmbuild/SRPMS
|
||||
.distro/centos7/rpmbuild/BUILD
|
||||
.distro/centos7/rpmbuild/BUILDROOT
|
||||
.distro/centos7/rpmbuild/SOURCES/io-monitor*tar.gz
|
202
middleware/io-monitor/recipes-common/io-monitor/LICENSE
Normal file
202
middleware/io-monitor/recipes-common/io-monitor/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
13
middleware/io-monitor/recipes-common/io-monitor/PKG-INFO
Normal file
13
middleware/io-monitor/recipes-common/io-monitor/PKG-INFO
Normal file
@ -0,0 +1,13 @@
|
||||
Metadata-Version: 1.1
|
||||
Name: io-monitor
|
||||
Version: 1.0
|
||||
Summary: Poll iostat and raise alarms for excessive conditions
|
||||
Home-page:
|
||||
Author: Windriver
|
||||
Author-email: info@windriver.com
|
||||
License: Apache-2.0
|
||||
|
||||
Description: Poll iostat and raise alarms for excessive conditions
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
@ -0,0 +1,3 @@
|
||||
SRC_DIR="io-monitor"
|
||||
COPY_LIST_TO_TAR="files scripts"
|
||||
TIS_PATCH_VER=6
|
@ -0,0 +1,81 @@
|
||||
Summary: Poll iostat and raise alarms for excessive conditions
|
||||
Name: io-monitor
|
||||
Version: 1.0
|
||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
||||
License: Apache-2.0
|
||||
Group: base
|
||||
Packager: Wind River <info@windriver.com>
|
||||
URL: unknown
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: systemd-units
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: fm-api
|
||||
Requires: /bin/systemctl
|
||||
|
||||
%description
|
||||
Poll iostat and raise alarms for excessive conditions
|
||||
|
||||
%define local_bindir /usr/bin/
|
||||
%define local_etc /etc/
|
||||
%define local_etc_initd /etc/init.d/
|
||||
%define local_etc_pmond /etc/pmon.d/
|
||||
%define local_etc_logrotated /etc/logrotate.d/
|
||||
%define pythonroot /usr/lib64/python2.7/site-packages
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
|
||||
%install
|
||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
|
||||
--install-lib=%{pythonroot} \
|
||||
--prefix=/usr \
|
||||
--install-data=/usr/share \
|
||||
--single-version-externally-managed
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc}%{name}
|
||||
install -p -D -m 700 files/io-monitor.conf %{buildroot}%{local_etc}%{name}/io-monitor.conf
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_pmond}
|
||||
install -p -D -m 644 scripts/pmon.d/io-monitor.conf %{buildroot}%{local_etc_pmond}/io-monitor.conf
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_initd}
|
||||
install -p -D -m 700 scripts/init.d/io-monitor-manager %{buildroot}%{local_etc_initd}/io-monitor-manager
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_bindir}
|
||||
install -p -D -m 700 scripts/bin/io-monitor-manager %{buildroot}%{local_bindir}/io-monitor-manager
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_logrotated}
|
||||
install -p -D -m 644 files/io-monitor.logrotate %{buildroot}%{local_etc_logrotated}/io-monitor.logrotate
|
||||
|
||||
install -d -m 755 %{buildroot}%{_unitdir}
|
||||
install -m 644 -p -D files/%{name}-manager.service %{buildroot}%{_unitdir}/%{name}-manager.service
|
||||
|
||||
%post
|
||||
/bin/systemctl enable %{name}-manager.service
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
# Note: The package name is io-monitor but the import name is io_monitor so
|
||||
# can't use '%{name}'.
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE
|
||||
%{local_bindir}/*
|
||||
%{local_etc}%{name}/*
|
||||
%{local_etc_initd}/*
|
||||
%{local_etc_pmond}/*
|
||||
%{_unitdir}/%{name}-manager.service
|
||||
%dir %{local_etc_logrotated}
|
||||
%{local_etc_logrotated}/*
|
||||
%dir %{pythonroot}/io_monitor
|
||||
%{pythonroot}/io_monitor/*
|
||||
%dir %{pythonroot}/io_monitor-%{version}.0-py2.7.egg-info
|
||||
%{pythonroot}/io_monitor-%{version}.0-py2.7.egg-info/*
|
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Daemon for polling iostat status
|
||||
After=local-fs.target
|
||||
Before=pmon.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Restart=no
|
||||
KillMode=process
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/rc.d/init.d/io-monitor-manager start
|
||||
ExecStop=/etc/rc.d/init.d/io-monitor-manager stop
|
||||
ExecReload=/etc/rc.d/init.d/io-monitor-manager reload
|
||||
PIDFile=/var/run/io-monitor/io-monitor-manager.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -0,0 +1,60 @@
|
||||
[DEFAULT]
|
||||
# Run as a daemon
|
||||
#daemon_mode = True
|
||||
|
||||
# Sleep interval (in seconds) between iostat executions [1..59]
|
||||
#wait_time = 1
|
||||
|
||||
#Global debug level. Note: All monitors will be clipped at this setting.
|
||||
#global_log_level = DEBUG
|
||||
|
||||
[cinder_congestion]
|
||||
# SSD: Large moving average window size (in samples).
|
||||
#ssd_large_window_size = 30
|
||||
|
||||
# SSD: Medium moving average window size (in samples).
|
||||
#ssd_medium_window_size = 60
|
||||
|
||||
# SSD: Small moving average window size (in samples).
|
||||
#ssd_small_window_size = 90
|
||||
|
||||
# SSD: Value required in a moving average window to trigger next state.
|
||||
#ssd_thresh_sustained_await = 1000
|
||||
|
||||
# SSD: Max await time. Anomalous data readings are clipped to this.
|
||||
#ssd_thresh_max_await = 5000
|
||||
|
||||
# HDD: Large moving average window size (in samples).
|
||||
#hdd_large_window_size = 240
|
||||
|
||||
# HDD: Medium moving average window size (in samples).
|
||||
#hdd_medium_window_size = 180
|
||||
|
||||
# HDD: Small moving average window size (in samples).
|
||||
#hdd_small_window_size = 120
|
||||
|
||||
# HDD: Value required in a moving average window to trigger next state.
|
||||
#hdd_thresh_sustained_await = 1500
|
||||
|
||||
# HDD: Max await time. Anomalous data readings are clipped to this.
|
||||
#hdd_thresh_max_await = 5000
|
||||
|
||||
# Monitor debug level. Note: global level must be equialent or lower.
|
||||
#log_level = INFO
|
||||
|
||||
# Modify how often status messages appear in the log. 0.0 is never, 1.0 is for
|
||||
# every iostat execution.
|
||||
#status_log_rate_modifier = 0.2
|
||||
|
||||
# Enable FM Alarm generation
|
||||
#generate_fm_alarms = True
|
||||
|
||||
# Number of same consecutive congestion state seen before raising/clearing alarms.
|
||||
#fm_alarm_debounce = 5
|
||||
|
||||
# Write monitor data to a csv for analysis
|
||||
#output_write_csv = False
|
||||
|
||||
# Directory where monitor output will be located.
|
||||
#output_csv_dir = /tmp
|
||||
|
@ -0,0 +1,11 @@
|
||||
/var/log/io-monitor.log {
|
||||
nodateext
|
||||
size 10M
|
||||
start 1
|
||||
rotate 10
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
import pbr.version
|
||||
|
||||
__version__ = pbr.version.VersionInfo('io-monitor').version_string()
|
||||
__release__ = pbr.version.VersionInfo('io-monitor').release_string()
|
@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
import oslo_i18n as i18n
|
||||
|
||||
DOMAIN = 'io_monitor'
|
||||
_translators = i18n.TranslatorFactory(domain=DOMAIN)
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
# HOST OS
|
||||
|
||||
WRLINUX = 'wrlinux'
|
||||
CENTOS = 'CentOS Linux'
|
||||
|
||||
# ALARMS
|
||||
|
||||
# Reasons for alarm
|
||||
ALARM_REASON_BUILDING = _('Cinder I/O Congestion is above normal range and '
|
||||
'is building')
|
||||
ALARM_REASON_CONGESTED = _('Cinder I/O Congestion is high and impacting '
|
||||
'guest performance')
|
||||
|
||||
# Repair actions for alarm
|
||||
REPAIR_ACTION_MAJOR_ALARM = _('Reduce the I/O load on the Cinder LVM '
|
||||
'backend. Use Cinder QoS mechanisms on high '
|
||||
'usage volumes.')
|
||||
REPAIR_ACTION_CRITICAL_ALARM = _('Reduce the I/O load on the Cinder LVM '
|
||||
'backend. Cinder actions may fail until '
|
||||
'congestion is reduced. Use Cinder QoS '
|
||||
'mechanisms on high usage volumes.')
|
||||
|
||||
# All cinder volume group device mapper names begin with this
|
||||
CINDER_DM_PREFIX = 'cinder--volumes'
|
@ -0,0 +1,189 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
|
||||
# IMPORTS
|
||||
import logging
|
||||
import time
|
||||
import math
|
||||
import os
|
||||
import sys
|
||||
|
||||
from daemon import runner
|
||||
from io_monitor import __version__
|
||||
from io_monitor.constants import DOMAIN
|
||||
from io_monitor.options import CONF
|
||||
from io_monitor.options import add_common_opts
|
||||
from io_monitor.monitors.cinder.congestion import CinderCongestionMonitor
|
||||
import subprocess
|
||||
|
||||
# OPTIONS
|
||||
|
||||
# CONSTANTS
|
||||
LOG_FILE = '/var/log/io-monitor.log'
|
||||
PID_FILE = '/var/run/io-monitor/io-monitor-manager.pid'
|
||||
CONFIG_COMPLETE = '/etc/platform/.initial_config_complete'
|
||||
|
||||
LOG = logging.getLogger(DOMAIN)
|
||||
|
||||
LOG_FORMAT_DEBUG = '%(asctime)s.%(msecs)03d: ' \
|
||||
+ os.path.basename(sys.argv[0]) + '[%(process)s]: ' \
|
||||
+ '%(filename)s(%(lineno)s) - %(funcName)-20s: ' \
|
||||
+ '%(levelname)s: %(message)s'
|
||||
|
||||
LOG_FORMAT_NORMAL = '%(asctime)s.%(msecs)03d: [%(process)s]: ' \
|
||||
+ '%(levelname)s: %(message)s'
|
||||
|
||||
|
||||
# METHODS
|
||||
def _start_polling(log_handle):
|
||||
io_monitor_daemon = IOMonitorDaemon()
|
||||
io_monitor_runner = runner.DaemonRunner(io_monitor_daemon)
|
||||
io_monitor_runner.daemon_context.umask = 0o022
|
||||
io_monitor_runner.daemon_context.files_preserve = [log_handle.stream]
|
||||
io_monitor_runner.do_action()
|
||||
|
||||
|
||||
def handle_exception(exc_type, exc_value, exc_traceback):
|
||||
"""
|
||||
Exception handler to log any uncaught exceptions
|
||||
"""
|
||||
LOG.error("Uncaught exception",
|
||||
exc_info=(exc_type, exc_value, exc_traceback))
|
||||
sys.__excepthook__(exc_type, exc_value, exc_traceback)
|
||||
|
||||
|
||||
def configure_logging():
|
||||
|
||||
level_dict = {'ERROR': logging.ERROR,
|
||||
'WARN': logging.WARN,
|
||||
'INFO': logging.INFO,
|
||||
'DEBUG': logging.DEBUG}
|
||||
|
||||
if CONF.global_log_level in level_dict.keys():
|
||||
level = level_dict[CONF.global_log_level]
|
||||
else:
|
||||
level = logging.INFO
|
||||
|
||||
# When we deamonize the default logging stream handler is closed. We need
|
||||
# manually setup logging so that we can pass the file_handler into the
|
||||
# monitor classes.
|
||||
LOG.setLevel(level)
|
||||
h = logging.FileHandler(LOG_FILE)
|
||||
h.setLevel(level)
|
||||
f = logging.Formatter(LOG_FORMAT_NORMAL, datefmt='%Y-%m-%d %H:%M:%S')
|
||||
h.setFormatter(f)
|
||||
LOG.addHandler(h)
|
||||
|
||||
# Log uncaught exceptions to file
|
||||
sys.excepthook = handle_exception
|
||||
|
||||
return h
|
||||
|
||||
|
||||
def main():
|
||||
# Set up configuration options
|
||||
add_common_opts()
|
||||
CONF(project='io-monitor', version=__version__)
|
||||
|
||||
# Set up logging. Allow all levels. The monitor will restrict the level
|
||||
# further as it sees fit
|
||||
log_handle = configure_logging()
|
||||
|
||||
# Dump config
|
||||
CONF.log_opt_values(LOG, logging.INFO)
|
||||
if CONF.daemon_mode:
|
||||
sys.argv = [sys.argv[0], 'start']
|
||||
_start_polling(log_handle)
|
||||
|
||||
|
||||
# CLASSES
|
||||
|
||||
class IOMonitorDaemon():
|
||||
""" Daemon process representation of
|
||||
the iostat monitoring program
|
||||
"""
|
||||
def __init__(self):
|
||||
# Daemon-specific init
|
||||
self.stdin_path = '/dev/null'
|
||||
self.stdout_path = '/dev/null'
|
||||
self.stderr_path = '/dev/null'
|
||||
self.pidfile_path = PID_FILE
|
||||
self.pidfile_timeout = 5
|
||||
|
||||
# Monitors
|
||||
self.ccm = None
|
||||
|
||||
def run(self):
|
||||
|
||||
# We are started by systemd so wait for initial config to be completed
|
||||
while not os.path.exists(CONFIG_COMPLETE):
|
||||
LOG.info("Waiting: Initial configuration is not complete")
|
||||
time.sleep(30)
|
||||
|
||||
LOG.info("Initializing monitors..")
|
||||
# Cinder Congestion Monitor
|
||||
self.ccm = CinderCongestionMonitor()
|
||||
|
||||
# Ensure system is monitorable
|
||||
if not self.ccm.is_system_monitorable():
|
||||
LOG.error("This system in not configured for Cinder LVM")
|
||||
|
||||
# Wait for something to kill us. Since we are managed by pmon
|
||||
# we don't want to exit at this point
|
||||
def sleepy_time(t):
|
||||
while True:
|
||||
t = t * 2
|
||||
yield t
|
||||
|
||||
LOG.info("Will standby performing no further actions")
|
||||
for s in sleepy_time(1):
|
||||
time.sleep(s)
|
||||
|
||||
sys.exit()
|
||||
|
||||
LOG.info("Starting: Running iostat %d times per minute" %
|
||||
math.ceil(60/(CONF.wait_time+1)))
|
||||
|
||||
try:
|
||||
command = "iostat -dx -t -p ALL"
|
||||
while True:
|
||||
process = subprocess.Popen(command.split(),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
output, error = process.communicate()
|
||||
if output:
|
||||
# Send the iostat input to the monitor
|
||||
self._monitor_ccm_send_inputs(output)
|
||||
|
||||
# Instruct the monitor to process the data
|
||||
self._monitor_ccm_generate_output()
|
||||
|
||||
time.sleep(CONF.wait_time)
|
||||
except KeyboardInterrupt:
|
||||
LOG.info('Exiting...')
|
||||
|
||||
return_code = process.poll()
|
||||
LOG.error("return code = %s " % return_code)
|
||||
|
||||
def _monitor_ccm_send_inputs(self, inputs):
|
||||
# LOG.debug(inputs)
|
||||
|
||||
# Process output from iteration
|
||||
lines = inputs.split('\n')
|
||||
for pline in lines[2:]:
|
||||
self.ccm.parse_iostats(pline.strip())
|
||||
|
||||
def _monitor_ccm_generate_output(self):
|
||||
self.ccm.generate_status()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit("\nOnly root can run this\n")
|
||||
|
||||
main()
|
@ -0,0 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
@ -0,0 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
@ -0,0 +1,774 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
#
|
||||
# Copyright (c) 2016-2017 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
import collections
|
||||
import logging
|
||||
import pyudev
|
||||
import math
|
||||
import operator
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from fm_api import fm_api
|
||||
from fm_api import constants as fm_constants
|
||||
from io_monitor import constants
|
||||
from io_monitor.constants import DOMAIN
|
||||
from io_monitor.utils.data_collector import DeviceDataCollector
|
||||
from io_monitor.constants import _
|
||||
from oslo_config import cfg
|
||||
|
||||
ccm_opts = [
|
||||
cfg.IntOpt('ssd_small_window_size',
|
||||
default=30,
|
||||
help=('SSD: Small moving average window size (in seconds).')),
|
||||
cfg.IntOpt('ssd_medium_window_size',
|
||||
default=60,
|
||||
help=('SSD: Medium moving average window size (in seconds).')),
|
||||
cfg.IntOpt('ssd_large_window_size',
|
||||
default=90,
|
||||
help=('SSD: Large moving average window size (in seconds).')),
|
||||
cfg.IntOpt('ssd_thresh_sustained_await',
|
||||
default=1000,
|
||||
help=('SSD: Value required in a moving average window to '
|
||||
'trigger next state.')),
|
||||
cfg.IntOpt('ssd_thresh_max_await',
|
||||
default=5000,
|
||||
help=('SSD: Max await time. Anomalous data readings are clipped'
|
||||
' to this.')),
|
||||
cfg.IntOpt('hdd_small_window_size',
|
||||
default=120,
|
||||
help=('HDD: Small moving average window size (in seconds).')),
|
||||
cfg.IntOpt('hdd_medium_window_size',
|
||||
default=180,
|
||||
help=('HDD: Medium moving average window size (in seconds).')),
|
||||
cfg.IntOpt('hdd_large_window_size',
|
||||
default=240,
|
||||
help=('HDD: Large moving average window size (in seconds).')),
|
||||
cfg.IntOpt('hdd_thresh_sustained_await',
|
||||
default=1500,
|
||||
help=('HDD: Value required in a moving average window to '
|
||||
'trigger next state.')),
|
||||
cfg.IntOpt('hdd_thresh_max_await',
|
||||
default=5000,
|
||||
help=('HDD: Max await time. Anomalous data readings are clipped'
|
||||
' to this.')),
|
||||
cfg.StrOpt('log_level',
|
||||
default='INFO',
|
||||
choices=('ERROR', 'WARN', 'INFO', 'DEBUG'),
|
||||
help=('Monitor debug level. Note: global level must be'
|
||||
' equialent or lower.')),
|
||||
cfg.FloatOpt('status_log_rate_modifier', default=0.2,
|
||||
help=('Modify how often status messages appear in the log.'
|
||||
'0.0 is never, 1.0 is for every iostat execution.')),
|
||||
cfg.BoolOpt('generate_fm_alarms', default=True,
|
||||
help=('Enable FM Alarm generation')),
|
||||
cfg.IntOpt('fm_alarm_debounce', default=5,
|
||||
help=('Number of consecutive same congestion states seen '
|
||||
'before raising/clearing alarms.')),
|
||||
cfg.BoolOpt('output_write_csv', default=False,
|
||||
help=('Write monitor data to a csv for analysis')),
|
||||
cfg.StrOpt('output_csv_dir', default='/tmp',
|
||||
help=('Directory where monitor output will be located.')),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(ccm_opts, group="cinder_congestion")
|
||||
|
||||
LOG = logging.getLogger(DOMAIN)
|
||||
|
||||
|
||||
class CinderCongestionMonitor(object):
|
||||
# Congestion States
|
||||
STATUS_NORMAL = "Normal"
|
||||
STATUS_BUILDING = "Building"
|
||||
STATUS_CONGESTED = "Limiting"
|
||||
|
||||
# disk type
|
||||
CINDER_DISK_SSD = 0
|
||||
CINDER_DISK_HDD = 1
|
||||
|
||||
def __init__(self):
|
||||
# Setup logging
|
||||
level_dict = {'ERROR': logging.ERROR,
|
||||
'WARN': logging.WARN,
|
||||
'INFO': logging.INFO,
|
||||
'DEBUG': logging.DEBUG}
|
||||
|
||||
if CONF.cinder_congestion.log_level in level_dict.keys():
|
||||
LOG.setLevel(level_dict[CONF.cinder_congestion.log_level])
|
||||
else:
|
||||
LOG.setLevel(logging.INFO)
|
||||
|
||||
LOG.info("Initializing %s..." % self.__class__.__name__)
|
||||
|
||||
# DRBD file
|
||||
self.drbd_file = '/etc/drbd.d/drbd-cinder.res'
|
||||
|
||||
# iostat parsing regex
|
||||
self.ts_regex = re.compile(r"(\d{2}/\d{2}/\d{2,4}) "
|
||||
"(\d{2}:\d{2}:\d{2})")
|
||||
self.device_regex = re.compile(
|
||||
r"(\w+-?\w+)\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)"
|
||||
"\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)\s+"
|
||||
"(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)\s+(\d+.\d+)")
|
||||
|
||||
# window sizes
|
||||
self.s_window_sec = CONF.cinder_congestion.ssd_small_window_size
|
||||
self.m_window_sec = CONF.cinder_congestion.ssd_medium_window_size
|
||||
self.l_window_sec = CONF.cinder_congestion.ssd_large_window_size
|
||||
|
||||
# state variables
|
||||
self.latest_time = None
|
||||
self.congestion_status = self.STATUS_NORMAL
|
||||
|
||||
# init data collector
|
||||
self.device_dict = {}
|
||||
|
||||
# devices
|
||||
self.phys_cinder_device = None
|
||||
self.base_cinder_devs = []
|
||||
self.base_cinder_tracking_devs = []
|
||||
self.non_cinder_dynamic_devs = ['drbd0', 'drbd1', 'drbd2', 'drbd3',
|
||||
'drbd5']
|
||||
self.non_cinder_phys_devs = []
|
||||
|
||||
# set the default operational scenarios
|
||||
self.await_minimal_spike = CONF.cinder_congestion.ssd_thresh_max_await
|
||||
self.await_sustained_congestion = (
|
||||
CONF.cinder_congestion.ssd_thresh_sustained_await)
|
||||
|
||||
# FM
|
||||
self.fm_api = fm_api.FaultAPIs()
|
||||
self.fm_state_count = collections.Counter()
|
||||
|
||||
# CSV handle
|
||||
self.csv = None
|
||||
|
||||
# status logging
|
||||
self.status_skip_count = 0
|
||||
|
||||
# to compare with current g_count
|
||||
self.last_g_count = 0
|
||||
|
||||
message_rate = math.ceil(60 / (CONF.wait_time+1))
|
||||
self.status_skip_total = math.ceil(
|
||||
message_rate/(message_rate *
|
||||
CONF.cinder_congestion.status_log_rate_modifier))
|
||||
LOG.info("Display status message at %d per minute..." %
|
||||
(message_rate *
|
||||
CONF.cinder_congestion.status_log_rate_modifier))
|
||||
|
||||
# Clear any exiting alarms
|
||||
self._clear_fm()
|
||||
|
||||
def _is_number(self, s):
|
||||
try:
|
||||
float(s)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def command(self, arguments, **kwargs):
|
||||
""" Execute e command and capture stdout, stderr & return code """
|
||||
process = subprocess.Popen(
|
||||
arguments,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
**kwargs)
|
||||
out, err = process.communicate()
|
||||
return out, err, process.returncode
|
||||
|
||||
def device_path_to_device_node(self, device_path):
|
||||
try:
|
||||
output, _, _ = self.command(["udevadm", "settle", "-E",
|
||||
device_path])
|
||||
out, err, retcode = self. command(["readlink", "-f", device_path])
|
||||
out = out.rstrip()
|
||||
except Exception as e:
|
||||
return None
|
||||
|
||||
return out
|
||||
|
||||
def _get_disk_type(self, device_node):
|
||||
if device_node:
|
||||
proc_device_file = '/sys/block/' + device_node + \
|
||||
'/queue/rotational'
|
||||
if os.path.exists(proc_device_file):
|
||||
with open(proc_device_file) as fileobject:
|
||||
for line in fileobject:
|
||||
return int(line.rstrip())
|
||||
|
||||
# If the disk is unknown assume an SSD.
|
||||
return self.CINDER_DISK_SSD
|
||||
|
||||
|
||||
def _is_cinder_related_device(self,device_node):
|
||||
name = ""
|
||||
if device_node:
|
||||
proc_device_file = '/sys/block/' + device_node + \
|
||||
'/dm/name'
|
||||
|
||||
if os.path.exists(proc_device_file):
|
||||
with open(proc_device_file) as fileobject:
|
||||
for line in fileobject:
|
||||
name = line.rstrip()
|
||||
|
||||
if constants.CINDER_DM_PREFIX in name:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _is_cinder_backing_device(self, device_node):
|
||||
name = ""
|
||||
if device_node:
|
||||
proc_device_file = '/sys/block/' + device_node + \
|
||||
'/dm/name'
|
||||
if os.path.exists(proc_device_file):
|
||||
with open(proc_device_file) as fileobject:
|
||||
for line in fileobject:
|
||||
name = line.rstrip()
|
||||
|
||||
if any(s in name for s in ['pool', 'anchor']):
|
||||
if device_node not in self.base_cinder_devs:
|
||||
self.base_cinder_devs.append(device_node)
|
||||
if any(s in name for s in ['tdata', 'tmeta']):
|
||||
if device_node not in self.base_cinder_tracking_devs:
|
||||
self.base_cinder_tracking_devs.append(device_node)
|
||||
|
||||
LOG.info("Cinder Base Devices = %s; Tracking %s" % (
|
||||
self.base_cinder_devs, self.base_cinder_tracking_devs))
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _determine_cinder_devices(self):
|
||||
# Check to see if we have DRBD device we are syncing
|
||||
if os.path.exists(self.drbd_file):
|
||||
|
||||
# grab the data
|
||||
with open(self.drbd_file) as fileobject:
|
||||
|
||||
drbd_dev_regex = re.compile(r"device\s+/dev/(\w+);")
|
||||
drbd_disk_path_regex = re.compile(
|
||||
r"disk\s+\"(/dev/disk/by-path/(.+))\";")
|
||||
drbd_disk_node_regex = re.compile(r"/dev/(\w+)")
|
||||
partition_regex = re.compile(r"(sd\w+)\d+")
|
||||
|
||||
for line in fileobject:
|
||||
m = drbd_dev_regex.match(line.strip())
|
||||
if m:
|
||||
self.base_cinder_devs.append(m.group(1))
|
||||
|
||||
m = drbd_disk_path_regex.match(line.strip())
|
||||
if m:
|
||||
drbd_disk = self.device_path_to_device_node(m.group(1))
|
||||
|
||||
drbd_disk_sd = drbd_disk_node_regex.match(drbd_disk)
|
||||
if drbd_disk_sd:
|
||||
self.base_cinder_devs.append(drbd_disk_sd.group(1))
|
||||
|
||||
d = partition_regex.match(drbd_disk_sd.group(1))
|
||||
if d:
|
||||
self.phys_cinder_device = d.group(1)
|
||||
self.base_cinder_devs.append(d.group(1))
|
||||
|
||||
# Which host OS?
|
||||
if platform.linux_distribution()[0] == constants.WRLINUX:
|
||||
dm_major = 252
|
||||
else:
|
||||
dm_major = 253
|
||||
|
||||
# Grab the device mapper devices and pull out the base cinder
|
||||
# devices
|
||||
dmsetup_regex = re.compile(r'^([\w-]+)\s+\((\d+):(\d+)\)')
|
||||
|
||||
dmsetup_command = 'dmsetup ls'
|
||||
dmsetup_process = subprocess.Popen(dmsetup_command,
|
||||
stdout=subprocess.PIPE,
|
||||
shell=True)
|
||||
dmsetup_output = dmsetup_process.stdout.read()
|
||||
lines = dmsetup_output.split('\n')
|
||||
for l in lines:
|
||||
m = dmsetup_regex.match(l.strip())
|
||||
if m:
|
||||
if m.group(2) == str(dm_major):
|
||||
# LOG.debug("%s %s %s" % (m.group(1),
|
||||
# m.group(2),
|
||||
# m.group(3)))
|
||||
if constants.CINDER_DM_PREFIX in m.group(1):
|
||||
if 'pool' in m.group(1) or 'anchor' in m.group(1):
|
||||
self.base_cinder_devs.append(
|
||||
"dm-" + m.group(3))
|
||||
if 'tdata' in m.group(1) or 'tmeta' in m.group(1):
|
||||
self.base_cinder_tracking_devs.append(
|
||||
"dm-" + m.group(3))
|
||||
else:
|
||||
self.non_cinder_dynamic_devs.append(
|
||||
"dm-" + m.group(3))
|
||||
|
||||
# If the tracking devs are non existant, then we didn't find any
|
||||
# thin pool entries. Therefore we are thickly provisioned and need
|
||||
# to track the physical device
|
||||
if len(self.base_cinder_tracking_devs) == 0:
|
||||
self.base_cinder_tracking_devs.append(
|
||||
self.phys_cinder_device)
|
||||
|
||||
# Use UDEV info to grab all phyical disks
|
||||
context = pyudev.Context()
|
||||
for device in context.list_devices(subsystem='block',
|
||||
DEVTYPE='disk'):
|
||||
if device['MAJOR'] == '8':
|
||||
device = str(os.path.basename(device['DEVNAME']))
|
||||
if device != self.phys_cinder_device:
|
||||
self.non_cinder_phys_devs.append(device)
|
||||
|
||||
def _update_device_stats(self, ts, device, current_iops, current_await):
|
||||
if device not in self.device_dict:
|
||||
# For AIO systems nova-local will be provisioned later and
|
||||
# differently based on the instance_backing value for the compute
|
||||
# functionality. Check for cinder specific dm devices and ignore
|
||||
# all others
|
||||
if not self._is_cinder_related_device(device):
|
||||
return
|
||||
self._is_cinder_backing_device(device)
|
||||
self.device_dict.update(
|
||||
{device: DeviceDataCollector(
|
||||
device,
|
||||
[DeviceDataCollector.DATA_IOPS,
|
||||
DeviceDataCollector.DATA_AWAIT],
|
||||
self.s_window_sec,
|
||||
self.m_window_sec,
|
||||
self.l_window_sec)})
|
||||
self.device_dict[device].set_data_caps(
|
||||
DeviceDataCollector.DATA_AWAIT,
|
||||
self.await_minimal_spike)
|
||||
self.device_dict[device].set_congestion_thresholds(
|
||||
self.await_minimal_spike,
|
||||
self.await_sustained_congestion)
|
||||
|
||||
self.device_dict[device].update_data(ts,
|
||||
DeviceDataCollector.DATA_IOPS,
|
||||
current_iops)
|
||||
self.device_dict[device].update_data(ts,
|
||||
DeviceDataCollector.DATA_AWAIT,
|
||||
current_await)
|
||||
self.device_dict[device].update_congestion_status()
|
||||
|
||||
def is_system_monitorable(self):
|
||||
if not os.path.exists(self.drbd_file):
|
||||
LOG.error("%s does not exist" % self.drbd_file)
|
||||
return False
|
||||
|
||||
# Discover devices on this host
|
||||
self._determine_cinder_devices()
|
||||
|
||||
# Get the cinder disk type and set the monitor values accordingly
|
||||
disk_type = self._get_disk_type(self.phys_cinder_device)
|
||||
if disk_type:
|
||||
self.s_window_sec = CONF.cinder_congestion.hdd_small_window_size
|
||||
self.m_window_sec = CONF.cinder_congestion.hdd_medium_window_size
|
||||
self.l_window_sec = CONF.cinder_congestion.hdd_large_window_size
|
||||
self.await_minimal_spike = (
|
||||
CONF.cinder_congestion.hdd_thresh_max_await)
|
||||
self.await_sustained_congestion = (
|
||||
CONF.cinder_congestion.hdd_thresh_sustained_await)
|
||||
else:
|
||||
self.s_window_sec = CONF.cinder_congestion.ssd_small_window_size
|
||||
self.m_window_sec = CONF.cinder_congestion.ssd_medium_window_size
|
||||
self.l_window_sec = CONF.cinder_congestion.ssd_large_window_size
|
||||
self.await_minimal_spike = (
|
||||
CONF.cinder_congestion.ssd_thresh_max_await)
|
||||
self.await_sustained_congestion = (
|
||||
CONF.cinder_congestion.ssd_thresh_sustained_await)
|
||||
|
||||
LOG.info("Physical Cinder Disk = %s - %s" %
|
||||
(self.phys_cinder_device,
|
||||
"HDD" if disk_type else "SSD"))
|
||||
LOG.info("Cinder Base Devices = %s; Tracking %s" % (
|
||||
self.base_cinder_devs, self.base_cinder_tracking_devs))
|
||||
LOG.info("Non-Cinder Devices = %s" % (
|
||||
self.non_cinder_dynamic_devs + self.non_cinder_phys_devs))
|
||||
|
||||
return True
|
||||
|
||||
def get_operational_thresholds(self):
|
||||
return (self.await_minimal_spike,
|
||||
self.await_sustained_congestion)
|
||||
|
||||
def set_operational_thresholds(self,
|
||||
await_minimal_spike,
|
||||
await_sustained_congestion):
|
||||
if await_minimal_spike:
|
||||
self.await_minimal_spike = await_minimal_spike
|
||||
if await_sustained_congestion:
|
||||
self.await_sustained_congestion = await_sustained_congestion
|
||||
|
||||
def _flush_stale_devices(self):
|
||||
for d in self.device_dict.keys():
|
||||
if self.device_dict[d].is_data_stale(self.latest_time):
|
||||
self.device_dict.pop(d, None)
|
||||
|
||||
def _log_device_data_windows(self, device):
|
||||
LOG.debug("%-6s: %s %s" % (
|
||||
device,
|
||||
self.device_dict[device].get_element_windows_avg_string(
|
||||
DeviceDataCollector.DATA_AWAIT),
|
||||
self.device_dict[device].get_element_windows_avg_string(
|
||||
DeviceDataCollector.DATA_IOPS)))
|
||||
|
||||
def _log_congestion_status(self, congestion_data):
|
||||
congestion_data.c_freq_dict.update(
|
||||
dict.fromkeys(
|
||||
set(['N', 'B', 'L']).difference(
|
||||
congestion_data.c_freq_dict), 0))
|
||||
congestion_data.g_freq_dict.update(
|
||||
dict.fromkeys(
|
||||
set(['N', 'B', 'L']).difference(
|
||||
congestion_data.g_freq_dict), 0))
|
||||
|
||||
LOG.info("Status (%-8s): Cinder Devs IOPS [ %10.2f, %10.2f, %10.2f ] "
|
||||
"Guests Counts %s; Guest Await[ %10.2f, %10.2f, %10.2f ]" % (
|
||||
congestion_data.status,
|
||||
congestion_data.c_iops_avg_list[0],
|
||||
congestion_data.c_iops_avg_list[1],
|
||||
congestion_data.c_iops_avg_list[2],
|
||||
dict(congestion_data.g_freq_dict),
|
||||
congestion_data.g_await_avg_list[0],
|
||||
congestion_data.g_await_avg_list[1],
|
||||
congestion_data.g_await_avg_list[2]))
|
||||
|
||||
def _determine_congestion_state(self):
|
||||
|
||||
# Analyze devices
|
||||
cinder_congestion_freq = collections.Counter()
|
||||
cinder_iops_avg = [0.0, 0.0, 0.0]
|
||||
guest_congestion_freq = collections.Counter()
|
||||
guest_await_avg = [0.0, 0.0, 0.0]
|
||||
|
||||
for d, dc in self.device_dict.iteritems():
|
||||
if d in self.base_cinder_devs:
|
||||
if d in self.base_cinder_tracking_devs:
|
||||
cinder_congestion_freq.update(dc.get_congestion_status())
|
||||
cinder_iops_avg = map(operator.add,
|
||||
cinder_iops_avg,
|
||||
dc.get_element_windows_avg_list(
|
||||
DeviceDataCollector.DATA_IOPS))
|
||||
# LOG.debug("C: %s " % cinder_iops_avg)
|
||||
# self._log_device_data_windows(d)
|
||||
|
||||
elif d not in (self.base_cinder_devs +
|
||||
self.non_cinder_dynamic_devs +
|
||||
self.non_cinder_phys_devs):
|
||||
guest_congestion_freq.update(
|
||||
dc.get_congestion_status(debug=True))
|
||||
guest_await_avg = map(operator.add,
|
||||
guest_await_avg,
|
||||
dc.get_element_windows_avg_list(
|
||||
DeviceDataCollector.DATA_AWAIT))
|
||||
# LOG.debug("G: %s " % guest_await_avg)
|
||||
# self._log_device_data_windows(d)
|
||||
|
||||
if list(cinder_congestion_freq.elements()):
|
||||
cinder_iops_avg[:] = [i/len(list(
|
||||
cinder_congestion_freq.elements())) for i in cinder_iops_avg]
|
||||
|
||||
if list(guest_congestion_freq.elements()):
|
||||
guest_await_avg[:] = [i/len(list(
|
||||
guest_congestion_freq.elements())) for i in guest_await_avg]
|
||||
|
||||
self.congestion_status = self.STATUS_NORMAL
|
||||
if DeviceDataCollector.STATUS_BUILDING in guest_congestion_freq:
|
||||
self.congestion_status = self.STATUS_BUILDING
|
||||
if DeviceDataCollector.STATUS_CONGESTED in guest_congestion_freq:
|
||||
self.congestion_status = self.STATUS_CONGESTED
|
||||
|
||||
congestion_data = collections.namedtuple("congestion_data",
|
||||
["timestamp", "status",
|
||||
"c_freq_dict",
|
||||
"c_iops_avg_list",
|
||||
"g_count",
|
||||
"g_freq_dict",
|
||||
"g_await_avg_list"])
|
||||
|
||||
return congestion_data(self.latest_time,
|
||||
self.congestion_status,
|
||||
cinder_congestion_freq,
|
||||
cinder_iops_avg,
|
||||
sum(guest_congestion_freq.values()),
|
||||
guest_congestion_freq,
|
||||
guest_await_avg)
|
||||
|
||||
def _clear_fm(self):
|
||||
building = fm_constants.FM_ALARM_ID_STORAGE_CINDER_IO_BUILDING
|
||||
limiting = fm_constants.FM_ALARM_ID_STORAGE_CINDER_IO_LIMITING
|
||||
|
||||
entity_instance_id = "cinder_io_monitor"
|
||||
ccm_alarm_ids = [building, limiting]
|
||||
|
||||
existing_alarms = []
|
||||
for alarm_id in ccm_alarm_ids:
|
||||
alarm_list = self.fm_api.get_faults_by_id(alarm_id)
|
||||
if not alarm_list:
|
||||
continue
|
||||
for alarm in alarm_list:
|
||||
existing_alarms.append(alarm)
|
||||
|
||||
if len(existing_alarms) > 1:
|
||||
LOG.warn("WARNING: we have more than one existing alarm")
|
||||
|
||||
for a in existing_alarms:
|
||||
self.fm_api.clear_fault(a.alarm_id, entity_instance_id)
|
||||
LOG.info(
|
||||
_("Clearing congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
a.uuid, a.severity, a.reason_text, True))
|
||||
|
||||
def _update_fm(self, debounce_count, override=None):
|
||||
|
||||
building = fm_constants.FM_ALARM_ID_STORAGE_CINDER_IO_BUILDING
|
||||
limiting = fm_constants.FM_ALARM_ID_STORAGE_CINDER_IO_LIMITING
|
||||
|
||||
if override:
|
||||
self.congestion_status = override
|
||||
|
||||
# Update the status count
|
||||
self.fm_state_count.update(self.congestion_status[0])
|
||||
|
||||
# Debounce alarms: If I have more than one congestion type then clear
|
||||
# the counts as we have crossed a threshold
|
||||
if len(self.fm_state_count) > 1:
|
||||
self.fm_state_count.clear()
|
||||
self.fm_state_count.update(self.congestion_status[0])
|
||||
return
|
||||
|
||||
# Debounce alarms: Make sure we have see this alarm state for a specifc
|
||||
# number of samples
|
||||
count = self.fm_state_count.itervalues().next()
|
||||
if count < debounce_count:
|
||||
return
|
||||
|
||||
# We are past the debounce state. Now take action.
|
||||
entity_instance_id = "cinder_io_monitor"
|
||||
ccm_alarm_ids = [building, limiting]
|
||||
|
||||
existing_alarms = []
|
||||
for alarm_id in ccm_alarm_ids:
|
||||
alarm_list = self.fm_api.get_faults_by_id(alarm_id)
|
||||
if not alarm_list:
|
||||
continue
|
||||
for alarm in alarm_list:
|
||||
existing_alarms.append(alarm)
|
||||
|
||||
if len(existing_alarms) > 1:
|
||||
LOG.warn("WARNING: we have more than one existing alarm")
|
||||
|
||||
if self.congestion_status is self.STATUS_NORMAL:
|
||||
for a in existing_alarms:
|
||||
self.fm_api.clear_fault(a.alarm_id, entity_instance_id)
|
||||
LOG.info(
|
||||
_("Clearing congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
a.uuid, a.severity, a.reason_text, True))
|
||||
|
||||
elif self.congestion_status is self.STATUS_BUILDING:
|
||||
alarm_is_raised = False
|
||||
for a in existing_alarms:
|
||||
if a.alarm_id != building:
|
||||
self.fm_api.clear_fault(a.alarm_id, entity_instance_id)
|
||||
LOG.info(
|
||||
_("Clearing congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
a.uuid, a.severity, a.reason_text, True))
|
||||
else:
|
||||
alarm_is_raised = True
|
||||
|
||||
if not alarm_is_raised:
|
||||
severity = fm_constants.FM_ALARM_SEVERITY_MAJOR
|
||||
reason_text = constants.ALARM_REASON_BUILDING
|
||||
|
||||
fault = fm_api.Fault(
|
||||
alarm_id=building,
|
||||
alarm_type=fm_constants.FM_ALARM_TYPE_2,
|
||||
alarm_state=fm_constants.FM_ALARM_STATE_SET,
|
||||
entity_type_id=fm_constants.FM_ENTITY_TYPE_CLUSTER,
|
||||
entity_instance_id=entity_instance_id,
|
||||
severity=severity,
|
||||
reason_text=reason_text,
|
||||
probable_cause=fm_constants.ALARM_PROBABLE_CAUSE_8,
|
||||
proposed_repair_action=constants.REPAIR_ACTION_MAJOR_ALARM,
|
||||
service_affecting=True)
|
||||
alarm_uuid = self.fm_api.set_fault(fault)
|
||||
if alarm_uuid:
|
||||
LOG.info(
|
||||
_("Created congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
alarm_uuid, severity, reason_text, True))
|
||||
else:
|
||||
LOG.error(
|
||||
_("Failed to create congestion alarm - severity: {},"
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
severity, reason_text, True))
|
||||
|
||||
elif self.congestion_status is self.STATUS_CONGESTED:
|
||||
alarm_is_raised = False
|
||||
for a in existing_alarms:
|
||||
if a.alarm_id != limiting:
|
||||
self.fm_api.clear_fault(a.alarm_id, entity_instance_id)
|
||||
LOG.info(
|
||||
_("Clearing congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
a.uuid, a.severity, a.reason_text, True))
|
||||
else:
|
||||
alarm_is_raised = True
|
||||
|
||||
if not alarm_is_raised:
|
||||
severity = fm_constants.FM_ALARM_SEVERITY_CRITICAL
|
||||
reason_text = constants.ALARM_REASON_CONGESTED
|
||||
repair = constants.REPAIR_ACTION_CRITICAL_ALARM
|
||||
fault = fm_api.Fault(
|
||||
alarm_id=limiting,
|
||||
alarm_type=fm_constants.FM_ALARM_TYPE_2,
|
||||
alarm_state=fm_constants.FM_ALARM_STATE_SET,
|
||||
entity_type_id=fm_constants.FM_ENTITY_TYPE_CLUSTER,
|
||||
entity_instance_id=entity_instance_id,
|
||||
severity=severity,
|
||||
reason_text=reason_text,
|
||||
probable_cause=fm_constants.ALARM_PROBABLE_CAUSE_8,
|
||||
proposed_repair_action=repair,
|
||||
service_affecting=True)
|
||||
alarm_uuid = self.fm_api.set_fault(fault)
|
||||
if alarm_uuid:
|
||||
LOG.info(
|
||||
_("Created congestion alarm {} - severity: {}, "
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
alarm_uuid, severity, reason_text, True))
|
||||
else:
|
||||
LOG.error(
|
||||
_("Failed to congestion storage alarm - severity: {},"
|
||||
"reason: {}, service_affecting: {}").format(
|
||||
severity, reason_text, True))
|
||||
|
||||
def _create_output(self, output_dir, congestion_data):
|
||||
if not self.csv:
|
||||
LOG.info("Creating output")
|
||||
if os.path.exists(output_dir):
|
||||
if output_dir.endswith('/'):
|
||||
fn = output_dir + 'ccm.csv'
|
||||
else:
|
||||
fn = output_dir + '/ccm.csv'
|
||||
else:
|
||||
fn = '/tmp/ccm.csv'
|
||||
try:
|
||||
self.csv = open(fn, 'w')
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
self.csv.write("Timestamp, Congestion Status, "
|
||||
"Cinder Devs Normal, "
|
||||
"Cinder Devs Building, Cinder Devs Limiting,"
|
||||
"Cinder IOPS Small, "
|
||||
"Cinder IOPS Med, Cinder IOPS Large,"
|
||||
"Guest Vols Normal, "
|
||||
"Guest Vols Building, Guest Vols Limiting,"
|
||||
"Guest Await Small, "
|
||||
"Guest Await Med, Guest Await Large")
|
||||
LOG.info("Done writing")
|
||||
|
||||
congestion_data.c_freq_dict.update(
|
||||
dict.fromkeys(set(['N', 'B', 'L']).difference(
|
||||
congestion_data.c_freq_dict), 0))
|
||||
congestion_data.g_freq_dict.update(
|
||||
dict.fromkeys(set(['N', 'B', 'L']).difference(
|
||||
congestion_data.g_freq_dict), 0))
|
||||
|
||||
self.csv.write(
|
||||
",".join(
|
||||
(str(congestion_data.timestamp),
|
||||
str(congestion_data.status[0]),
|
||||
str(congestion_data.c_freq_dict[
|
||||
DeviceDataCollector.STATUS_NORMAL]),
|
||||
str(congestion_data.c_freq_dict[
|
||||
DeviceDataCollector.STATUS_BUILDING]),
|
||||
str(congestion_data.c_freq_dict[
|
||||
DeviceDataCollector.STATUS_CONGESTED]),
|
||||
str(congestion_data.c_iops_avg_list[0]),
|
||||
str(congestion_data.c_iops_avg_list[1]),
|
||||
str(congestion_data.c_iops_avg_list[2]),
|
||||
str(congestion_data.g_freq_dict[
|
||||
DeviceDataCollector.STATUS_NORMAL]),
|
||||
str(congestion_data.g_freq_dict[
|
||||
DeviceDataCollector.STATUS_BUILDING]),
|
||||
str(congestion_data.g_freq_dict[
|
||||
DeviceDataCollector.STATUS_CONGESTED]),
|
||||
str(congestion_data.g_await_avg_list[0]),
|
||||
str(congestion_data.g_await_avg_list[1]),
|
||||
str(congestion_data.g_await_avg_list[2]))
|
||||
) + '\n'
|
||||
)
|
||||
|
||||
# flush the python buffer
|
||||
self.csv.flush()
|
||||
|
||||
# make sure the os pushes the data to disk
|
||||
os.fsync(self.csv.fileno())
|
||||
|
||||
def generate_status(self):
|
||||
# Purge stale devices
|
||||
self._flush_stale_devices()
|
||||
|
||||
# Get congestion state
|
||||
data = self._determine_congestion_state()
|
||||
if self.status_skip_count < self.status_skip_total:
|
||||
self.status_skip_count += 1
|
||||
else:
|
||||
self._log_congestion_status(data)
|
||||
self.status_skip_count = 0
|
||||
|
||||
# Send alarm updates to FM if configured and there are guest volumes
|
||||
# present (won't be on the standby controller)
|
||||
if CONF.cinder_congestion.generate_fm_alarms:
|
||||
if data.g_count > 0:
|
||||
self._update_fm(CONF.cinder_congestion.fm_alarm_debounce)
|
||||
elif data.g_count == 0 and self.last_g_count > 0:
|
||||
self._clear_fm()
|
||||
|
||||
# Save the current guest count view
|
||||
self.last_g_count = data.g_count
|
||||
|
||||
# Save output
|
||||
if CONF.cinder_congestion.output_write_csv:
|
||||
self._create_output(CONF.cinder_congestion.output_csv_dir,
|
||||
data)
|
||||
|
||||
def parse_iostats(self, line):
|
||||
# LOG.debug(line)
|
||||
m = self.ts_regex.match(line)
|
||||
if m:
|
||||
self.latest_time = m.group(0)
|
||||
|
||||
m = self.device_regex.match(line)
|
||||
if m:
|
||||
# LOG.debug(line)
|
||||
# LOG.debug("%s: %f %f" % (m.group(1) ,
|
||||
# float(m.group(4)) + float(m.group(5)),
|
||||
# float(m.group(10))))
|
||||
if not (self._is_number(m.group(4)) and
|
||||
self._is_number(m.group(5)) and
|
||||
self._is_number(m.group(10))):
|
||||
LOG.error("ValueError: invalid input: r/s = %s, w/s = %s "
|
||||
"await = %s" % (m.group(4), m.group(5), m.group(10)))
|
||||
else:
|
||||
if not any(s in m.group(1) for s in ['loop', 'ram', 'nb',
|
||||
'md', 'scd'] +
|
||||
self.non_cinder_phys_devs):
|
||||
self._update_device_stats(self.latest_time,
|
||||
m.group(1),
|
||||
(float(m.group(4)) +
|
||||
float(m.group(5))),
|
||||
float(m.group(10)))
|
@ -0,0 +1,27 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
#
|
||||
# Copyright (c) 2016 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
common_opts = [
|
||||
cfg.BoolOpt('daemon_mode', default=True,
|
||||
help=('Run as a daemon')),
|
||||
cfg.IntOpt('wait_time', default=1, min=1, max=59,
|
||||
help=('Sleep interval (in seconds) between iostat executions '
|
||||
'[1..59]')),
|
||||
cfg.StrOpt('global_log_level',
|
||||
default='DEBUG',
|
||||
choices=['DEBUG', 'INFO', 'WARN', 'ERROR'],
|
||||
help=('Global debug level. Note: All monitors will be clipped '
|
||||
'at this setting.'))
|
||||
]
|
||||
|
||||
|
||||
def add_common_opts():
|
||||
CONF.register_cli_opts(common_opts)
|
@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Copyright (c) 2017 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TEST_ROOT=$PWD
|
||||
HEAT_CHECK=${TEST_ROOT}/heat_check.sh
|
||||
|
||||
STRESSOR_CREATE=${TEST_ROOT}/cinder_stress_increment_create.sh
|
||||
STRESSOR_DELETE=${TEST_ROOT}/cinder_stress_increment_delete.sh
|
||||
|
||||
## one volume/VM/stack
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v1_bon0.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v1_bon1.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v1_bon1_cpuburn.yaml
|
||||
|
||||
## Two volumes/VM/stack
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v2_bon0.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v2_bon2.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v2_bon2_cpuburn.yaml
|
||||
|
||||
## 4 volumes/VM/stack
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v4_bon0.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v4_bon4.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_v4_bon4_cpuburn.yaml
|
||||
|
||||
## test
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon0.yaml
|
||||
YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon1.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon2.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon3.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon4.yaml
|
||||
#YAML=${TEST_ROOT}/yaml/cinder_nokia_v5_bon4_cpuburn.yaml
|
||||
|
||||
for stack_num in 1 2 4 8 14
|
||||
#for stack_num in $(seq 1 32)
|
||||
do
|
||||
|
||||
|
||||
echo "$stack_num: Creating stacks"
|
||||
sudo -u wrsroot ${STRESSOR_CREATE} $YAML $stack_num
|
||||
|
||||
source /etc/nova/openrc
|
||||
AM_I_CREATING="sudo -u wrsroot $HEAT_CHECK | grep CREATE_IN_PROGRESS"
|
||||
while [[ $(eval $AM_I_CREATING) != "" ]]; do
|
||||
echo "$stack_num: Creating..."
|
||||
sleep 15
|
||||
done
|
||||
|
||||
ANY_CREATE_ERRORS="sudo -u wrsroot $HEAT_CHECK | grep CREATE_FAILED"
|
||||
if [[ $(eval $ANY_CREATE_ERRORS) != "" ]]; then
|
||||
echo "$stack_num: Creating stacks failed"
|
||||
exit -1
|
||||
else
|
||||
# Run at steady state for 60s
|
||||
echo "$stack_num: Running at steady state for an additional 10 seconds"
|
||||
sleep 10
|
||||
fi
|
||||
|
||||
echo "$stack_num: Deleting stacks"
|
||||
sudo -u wrsroot ${STRESSOR_DELETE} $stack_num
|
||||
|
||||
AM_I_DELETING="sudo -u wrsroot $HEAT_CHECK | grep DELETE_IN_PROGRESS"
|
||||
while [[ $(eval $AM_I_DELETING) != "" ]]; do
|
||||
echo "$stack_num: Deleting..."
|
||||
done
|
||||
|
||||
ANY_DELETE_ERRORS="sudo -u wrsroot $HEAT_CHECK | grep DELETE_FAILED"
|
||||
if [[ $(eval $ANY_DELETE_ERRORS) != "" ]]; then
|
||||
echo "$stack_num: Deleting stacks failed"
|
||||
else
|
||||
echo "$stack_num: Create/Delete successful"
|
||||
fi
|
||||
|
||||
sleep 10
|
||||
|
||||
done
|
||||
|
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Copyright (c) 2017 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
case $# in
|
||||
0|1)
|
||||
echo "Usage: `basename $0` <yaml> <# of stacks>"
|
||||
exit $E_BADARGS
|
||||
;;
|
||||
esac
|
||||
|
||||
YAML=$1
|
||||
NUM_STACKS=$2
|
||||
|
||||
for i in $(seq 1 $NUM_STACKS)
|
||||
do
|
||||
source $HOME/openrc.tenant1
|
||||
heat stack-create -f $YAML stack-$i
|
||||
done
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user