Commit 53b620d9 authored by Fabrice PEIX's avatar Fabrice PEIX
Browse files

Add xinetd install doc

parent 4715bffb
......@@ -12,12 +12,62 @@ from jsonschema import ValidationError
VERSION = 0.1
XINETD_INSTALL = """
------------------------------------------------------------------
- xinetd template config,
------------------------------------------------------------------
service pybb
{
type = UNLISTED
port = 678
socket_type = stream
protocol = tcp
wait = no
user = root
env = PYTHONPATH=/home/sysop/pybb
server = <file path of pybb.py>
server_args = -c <filepath of config> --flat
# configure the IP address(es) of your Nagios server here:
#only_from = 127.0.0.1 10.0.20.1 10.0.20.2
# Don't be too verbose. Don't log every check. This might be
# commented out for debugging. If this option is commented out
# the default options will be used for this service.
log_on_success =
disable = no
}
------------------------------------------------------------------
+ xinetd installation on centos:
sudo yum install xinetd
+ xinetd configuration
copy modified version of given config file to /etc/xinetd.d
You must note that file permissions must be change:
sudo chmod go-rwx /etc/xinetd.d/pybb
+ start xinetd:
sudo systemctl start xinetd
+ start xinetd at boot time
sudo systemctl enable xinetd
"""
CONFIG_SCHEMA_PATH = os.path.join(os.path.dirname(__file__), 'schemas', 'config_schema.json')
def xinetd_info():
"""
Display sample xinetd configuration file and xinetd installation procedure
"""
print(XINETD_INSTALL)
def usage():
"""
Baseic usage method
Basic usage method
"""
print(sys.argv[0], " by Resif Team")
print("Print on stdout a JSON representation of system informations")
......@@ -34,8 +84,9 @@ def usage():
print("")
print("Common options")
print("")
print(" -o, --output Set an output filename instead of stdout")
print("-o, --output Set an output filename instead of stdout")
print("-h, --help Display this message")
print("--xinetd Display xinetd sample config with some related information")
print("-V, --version Print version information.")
......@@ -89,7 +140,7 @@ def main():
opts, _ = getopt.getopt(sys.argv[1:], "c:o:fhV",
["config=", "output=", "flat",
"generate_config=", "database_host=",
"help", "version"])
"help", "xinetd", "version"])
except getopt.GetoptError as err:
sys.stderr.write("Error: %s\n" % err)
usage()
......@@ -101,6 +152,9 @@ def main():
elif current_option in ("-h", "--help"):
usage()
sys.exit()
elif current_option in ("--xinetd",):
xinetd_info()
sys.exit()
elif current_option in ("-o", "--output"):
output_filename = current_argument
elif current_option in ("-f", "--flat"):
......@@ -137,6 +191,7 @@ def main():
sys.exit(1)
if config_filepath:
# Pybb execution according to given config file
config = load_config(config_filepath)
# Create Pybb
......@@ -169,7 +224,7 @@ def main():
generated_config = result["result"]
json.dump(generated_config, output_file, indent=2)
else:
sys.stderr.write("Internal error can'tt be here\n")
sys.stderr.write("Internal error can't be here\n")
sys.exit(1)
......
Supports Markdown
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