diff --git a/lemur.service b/lemur.service new file mode 100644 index 00000000..b5c1dbb3 --- /dev/null +++ b/lemur.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lemur +After=postgresql.service + +[Service] +ExecStart=/usr/bin/lemur start -b 127.0.0.1:8002 -c /etc/lemur/lemur.conf.py +User=lemur +Group=lemur + +[Install] +WantedBy=multi-user.target + diff --git a/posttemplate/03-lemur b/posttemplate/03-lemur index d1a07bf1..52418333 100755 --- a/posttemplate/03-lemur +++ b/posttemplate/03-lemur @@ -11,4 +11,7 @@ lemur --config=/etc/lemur/lemur.conf.py init --password $(CreoleGet lemur_admin_ systemctl stop postgresql.service rm -f *.log +mkdir -p /var/log/lemur/ +chown lemur: /var/log/lemur/ + exit 0 diff --git a/tmpl/lemur.conf.py b/tmpl/lemur.conf.py index f8ee4d9f..740ecc59 100644 --- a/tmpl/lemur.conf.py +++ b/tmpl/lemur.conf.py @@ -44,7 +44,7 @@ METRIC_PROVIDERS = [] # Logging LOG_LEVEL = "DEBUG" -LOG_FILE = "lemur.log" +LOG_FILE = "/var/log/lemur/lemur.log" # Database