-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ceph#4532 from dachary/wip-init-system-detection
ceph-detect-init helper and associated tests Reviewed-by: Ken Dreyer <[email protected]> Reviewed-by: Sage Weil <[email protected]>
- Loading branch information
Showing
43 changed files
with
1,040 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
:orphan: | ||
|
||
============================================================ | ||
ceph-detect-init -- display the init system Ceph should use | ||
============================================================ | ||
|
||
.. program:: ceph-detect-init | ||
|
||
Synopsis | ||
======== | ||
|
||
| **ceph-detect-init** [--verbose] [--use-rhceph] [--default *init*] | ||
Description | ||
=========== | ||
|
||
:program:`ceph-detect-init` is a utility that prints the init system | ||
Ceph uses. It can be one of ``sysvinit``, ``upstart`` or ``systemd``. | ||
The init system Ceph uses may not be the default init system of the | ||
host operating system. For instance on Debian Jessie, Ceph may use | ||
``sysvinit`` although ``systemd`` is the default. | ||
|
||
If the init system of the host operating system is unknown, return on | ||
error, unless :option:`--default` is specified. | ||
|
||
Options | ||
======= | ||
|
||
.. option:: --use-rhceph | ||
|
||
When an operating system identifies itself as Red Hat, it is | ||
treated as if it was CentOS. With :option:`--use-rhceph` it is | ||
treated as RHEL instead. | ||
|
||
.. option:: --default INIT | ||
|
||
If the init system of the host operating system is unkown, return | ||
the value of *INIT* instead of failing with an error. | ||
|
||
.. option:: --verbose | ||
|
||
Display additional information for debugging. | ||
|
||
Availability | ||
============ | ||
|
||
:program:`ceph-detect-init` is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to | ||
the Ceph documentation at http://ceph.com/docs for more information. | ||
|
||
See also | ||
======== | ||
|
||
:doc:`ceph-disk <ceph-disk>`\(8), | ||
:doc:`ceph-deploy <ceph-deploy>`\(8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# Ceph distributed storage system | ||
# | ||
# Copyright (C) 2014 Red Hat <[email protected]> | ||
# Copyright (C) 2014, 2015 Red Hat <[email protected]> | ||
# | ||
# Author: Loic Dachary <[email protected]> | ||
# | ||
|
@@ -83,3 +83,26 @@ CentOS|Fedora|RedHatEnterpriseServer) | |
echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually." | ||
;; | ||
esac | ||
|
||
# | ||
# preload python modules so that tox can run without network access | ||
# | ||
for interpreter in python2.7 python3 ; do | ||
type $interpreter > /dev/null 2>&1 || continue | ||
rm -fr install-deps | ||
virtualenv --python $interpreter install-deps | ||
. install-deps/bin/activate | ||
pip install wheel | ||
find . -name tox.ini | while read ini ; do | ||
( | ||
cd $(dirname $ini) | ||
require=$(ls *requirements.txt 2>/dev/null | sed -e 's/^/-r /') | ||
if test "$require" ; then | ||
# although pip comes with virtualenv, having a recent version | ||
# of pip matters when it comes to using wheel packages | ||
pip wheel $require 'distribute >= 0.7' 'pip >= 6.1' | ||
fi | ||
) | ||
done | ||
done | ||
rm -fr install-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*~ | ||
*.pyc | ||
*.pyo | ||
.coverage | ||
.tox | ||
*.egg-info | ||
*.egg | ||
dist | ||
build | ||
wheelhouse | ||
*.log | ||
*.trs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Owen Synge <[email protected]> | ||
- Loic Dachary <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include AUTHORS.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# | ||
# Copyright (C) 2015 SUSE LINUX GmbH | ||
# Copyright (C) 2015 <[email protected]> | ||
# | ||
# Author: Owen Synge <[email protected]> | ||
# Author: Loic Dachary <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see `<http://www.gnu.org/licenses/>`. | ||
# | ||
check_SCRIPTS += ceph-detect-init/run-tox.sh | ||
|
||
EXTRA_DIST += \ | ||
ceph-detect-init/AUTHORS.rst \ | ||
ceph-detect-init/ceph_detect_init/centos/__init__.py \ | ||
ceph-detect-init/ceph_detect_init/exc.py \ | ||
ceph-detect-init/ceph_detect_init/main.py \ | ||
ceph-detect-init/ceph_detect_init/__init__.py \ | ||
ceph-detect-init/ceph_detect_init/rhel/__init__.py \ | ||
ceph-detect-init/ceph_detect_init/fedora/__init__.py \ | ||
ceph-detect-init/ceph_detect_init/debian/__init__.py \ | ||
ceph-detect-init/ceph_detect_init/suse/__init__.py \ | ||
ceph-detect-init/integration/centos-6.dockerfile \ | ||
ceph-detect-init/integration/debian-wheezy.dockerfile \ | ||
ceph-detect-init/integration/debian-sid.dockerfile \ | ||
ceph-detect-init/integration/debian-jessie.dockerfile \ | ||
ceph-detect-init/integration/opensuse-13.1.dockerfile \ | ||
ceph-detect-init/integration/fedora-21.dockerfile \ | ||
ceph-detect-init/integration/ubuntu-14.04.dockerfile \ | ||
ceph-detect-init/integration/test_main.py \ | ||
ceph-detect-init/integration/opensuse-13.2.dockerfile \ | ||
ceph-detect-init/integration/ubuntu-12.04.dockerfile \ | ||
ceph-detect-init/integration/centos-7.dockerfile \ | ||
ceph-detect-init/integration/ubuntu-15.04.dockerfile \ | ||
ceph-detect-init/integration/debian-squeeze.dockerfile \ | ||
ceph-detect-init/Makefile.am \ | ||
ceph-detect-init/MANIFEST.in \ | ||
ceph-detect-init/README.rst \ | ||
ceph-detect-init/requirements.txt \ | ||
ceph-detect-init/run-tox.sh \ | ||
ceph-detect-init/setup.py \ | ||
ceph-detect-init/test-requirements.txt \ | ||
ceph-detect-init/tests/test_all.py \ | ||
ceph-detect-init/tox.ini | ||
|
||
all-local:: | ||
cd ceph-detect-init ; python setup.py build | ||
|
||
clean-local:: | ||
cd ceph-detect-init ; python setup.py clean ; rm -fr wheelhouse .tox build .coverage *.egg-info | ||
|
||
install-data-local:: | ||
cd ceph-detect-init ; \ | ||
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \ | ||
options=--install-layout=deb ; \ | ||
else \ | ||
options=--prefix=/usr ; \ | ||
fi ; \ | ||
python setup.py install --root=$(DESTDIR) $$options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ceph-detect-init | ||
================ | ||
|
||
ceph-detect-init is a command line tool that displays a normalized | ||
string describing the init system of the host on which it is running: | ||
|
||
Home page : https://pypi.python.org/pypi/ceph-detect-init | ||
|
||
Hacking | ||
======= | ||
|
||
* Get the code : git clone https://git.ceph.com/ceph.git | ||
* Run the unit tests : tox | ||
* Run the integration tests (requires docker) : tox -e integration | ||
* Check the documentation : rst2html < README.rst > /tmp/a.html | ||
* Prepare a new version | ||
|
||
- version=1.0.0 ; perl -pi -e "s/^version.*/version='$version',/" setup.py ; do python setup.py sdist ; amend=$(git log -1 --oneline | grep --quiet "version $version" && echo --amend) ; git commit $amend -m "version $version" setup.py ; git tag -a -f -m "version $version" $version ; done | ||
|
||
* Publish a new version | ||
|
||
- python setup.py sdist upload --sign | ||
- git push ; git push --tags | ||
|
||
* pypi maintenance | ||
|
||
- python setup.py register # if the project does not yet exist | ||
- trim old versions at https://pypi.python.org/pypi/ceph-detect-init |
Oops, something went wrong.