Commit 5978a646 by Szeberényi Imre

Initial version, Python 2.7

parents
*.pyc
*.swp
import logging
import sys
from src.client import Client
def main():
# define a Handler which writes INFO messages or higher to the sys.stderr
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s: %(levelname)s/%(name)s] %(message)s')
if len(sys.argv) < 2:
print("usage: manage.py run")
if len(sys.argv) is not 2 and sys.argv[1] is not "run":
print("[ERROR] Command cannot be parsed. Exiting...")
return
Client().run()
if __name__ == "__main__":
main()
description "CIRCLE monitor-client"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 300
setgid cloud
setuid cloud
script
cd /home/cloud/monitor-client
. /home/cloud/.virtualenvs/monitor-client/local/bin/activate
. /home/cloud/.virtualenvs/monitor-client/local/bin/postactivate
HOSTNAME=$(hostname -s)
python manage.py run
end script
post-stop exec sleep 15
[Unit]
Description=CIRCLE monitor-client
After=network.target
[Service]
User=cloud
Group=cloud
WorkingDirectory=/home/cloud/monitor-client
ExecStart=/bin/bash -c "source /etc/profile; workon monitor-client; exec python manage.py run"
Restart=always
[Install]
WantedBy=multi-user.target
__all__ = ["client", "collectables", "metrics", "cnfparse"]
This diff is collapsed. Click to expand it.
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 sign in to comment