Commit 954931ad authored by Dmytro Karpenko's avatar Dmytro Karpenko
Browse files

Assume that the OS is systemd-based by default.

parent d2fb2328
......@@ -40,13 +40,14 @@ python installation):
Installation
============
1. setup.py has been tested on and supports currently
1. setup.py has been tested on:
* RedHat 6.x
* RedHat 7.x
* Ubuntu 16.04
* Ubuntu 17.10
* Ubuntu 18.04
If you have other OS, see 'python jura_to_es.py --help' and launch
It should pretty much work OK on all systemd-based distros.
If it does not, see 'python jura_to_es.py --help' and launch
the tool manually. You might also have to launch the tool manually
if you have old Python 2.6.
1a. Remember to rerun setup.py if any parameter (ES host, index, etc.)
......@@ -59,7 +60,7 @@ Installation
--esindex <indexname>'
2c. Start the tool with '/etc/init.d/jura_to_es start'
2d. If needed, make 'jura_to_es' service startable at the boot with chkconfig.
3. On other supported OS:
3. On other OS:
3a. In the source code directory, run
'python setup.py install --juradir <path_to_your_jura_archiving_dir>'.
3b. If you need to use other ES host/port and index, than the hardcoded
......
......@@ -211,14 +211,12 @@ def monitor_dir(xml_dir, es, es_index, record_prefix, pidfile, logfile):
import platform
systemd_OS = False
systemd_OS = True
OS_name = platform.platform().split("with-", 1)[1]
if (OS_name.startswith("centos") or OS_name.startswith("redhat")
or OS_name.startswith("Ubuntu")):
if (OS_name.startswith("centos") or OS_name.startswith("redhat")):
OS_version = OS_name.split("-")[1]
if (OS_version.startswith("7") or OS_version.startswith("16.04")
or OS_version.startswith("17.10") or OS_version.startswith("18.04")):
systemd_OS = True
if OS_version.startswith("6"):
systemd_OS = False
if not systemd_OS:
# create daemon
......
......@@ -20,24 +20,12 @@ if '--esindex' in sys.argv:
sys.argv.pop(index) # Removes the '--esindex'
es_index = sys.argv.pop(index) # Returns the element after the '--esindex'
systemd_OS = True
OS_name = platform.platform().split("with-", 1)[1]
if not(OS_name.startswith("centos") or OS_name.startswith("redhat")
or OS_name.startswith("Ubuntu")):
print "Unsupported OS. Please, read the help of the python script itself"
print "and launch the command directly. Exiting."
sys.exit(1)
OS_version = OS_name.split("-")[1]
if OS_version.startswith("6"):
systemd_OS = False
elif (OS_version.startswith("7") or OS_version.startswith("16.04")
or OS_version.startswith("17.10") or OS_version.startswith("18.04")):
systemd_OS = True
else:
print "Unsupported OS version. Please, read the help of the python script itself"
print "and launch the command directly. Exiting."
sys.exit(1)
if (OS_name.startswith("centos") or OS_name.startswith("redhat")):
OS_version = OS_name.split("-")[1]
if OS_version.startswith("6"):
systemd_OS = False
if not systemd_OS:
tool_command_line = "CMD=\"$CMD -c 'import jura_to_es; jura_to_es.main([\\\"-m\\\", \\\"-d\\\", \\\"$JURA_ARCHIVING_DIR\\\""
......@@ -63,7 +51,7 @@ else:
sys.argv.pop(juradir) # Removes the '--juradir'
jura_dir = sys.argv.pop(juradir) # Returns the element after the '--juradir'
else:
print "For this OS version you have to specify the location of JURA archiving dir."
print "For this OS you have to specify the location of JURA archiving dir."
print "Please, rerun setup.py with --juradir parameter specified."
print "Exiting."
sys.exit(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment