Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon: use setproctitle to name process journalpump #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Depends: ${misc:Depends}, ${python3:Depends}, adduser,
python3-elasticsearch, python3-kafka,
python3-requests, python3-systemd,
python3-boto3, python3-googleapi,
python3-websockets, python3-aiohttp-socks, python3-snappy
python3-websockets, python3-aiohttp-socks, python3-snappy, python3-setproctitle
Description: daemon that takes log messages from journald and pumps them
to a given output. Currently supported outputs are Elasticsearch, Kafka,
Websocket, logplex, AWS CloudWatch and Google Cloud Logging. It reads
Expand Down
4 changes: 2 additions & 2 deletions journalpump.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ License: ASL 2.0
Source0: journalpump-rpm-src.tar.gz
Requires: python3-kafka, systemd-python3, python3-requests, python3-boto3, python3-google-api-client
Requires: python3-oauth2client, python3-geoip2, python3-typing-extensions
Requires: python3-websockets, python3-aiohttp-socks, python3-snappy
Requires: python3-websockets, python3-aiohttp-socks, python3-snappy, python3-setproctitle
BuildRequires: python3-kafka, systemd-python3, python3-requests, python3-boto3, python3-google-api-client
BuildRequires: python3-devel, python3-pytest, python3-pylint python3-responses
BuildRequires: python3-websockets, python3-aiohttp-socks, python3-snappy
BuildRequires: python3-websockets, python3-aiohttp-socks, python3-snappy, python3-setproctitle
BuildArch: noarch
Obsoletes: kafkajournalpump

Expand Down
3 changes: 3 additions & 0 deletions journalpump/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Common Daemon functionality

"""
from setproctitle import setproctitle
from systemd import daemon, journal

import json
Expand All @@ -14,6 +15,7 @@
import signal
import sys


LOG_FORMAT = "%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s"
LOG_FORMAT_JOURNAL = "%(name)-20s %(levelname)-8s %(message)s"
LOG_FORMAT_JOURNAL_MULTI_THREAD = "%(name)-20s %(threadName)-15s %(levelname)-8s %(message)s"
Expand Down Expand Up @@ -111,6 +113,7 @@ def main(cls, args):
try:
exe = cls(config_path=args[0])
daemon.notify("READY=1")
setproctitle("journalpump")
return exe.run()
except ServiceDaemonError as ex:
logging.fatal("%s failed to start: %s", cls.__name__, ex)
Expand Down
1 change: 1 addition & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ coverage
coveralls
responses
unify
setproctitle
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ google-api-python-client
oauth2client
geoip2
https://github.com/systemd/python-systemd/zipball/master
typing-extensions
typing-extensions
setproctitle
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"oauth2client",
"geoip2",
"typing-extensions",
"setproctitle",
],
dependency_links=[],
package_data={},
Expand Down