Skip to content

Commit

Permalink
Drop daemonization
Browse files Browse the repository at this point in the history
  • Loading branch information
bersace committed Jun 17, 2024
1 parent 0ad7cbc commit eef3510
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 220 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Ensure you use consistent title format.

- ui: Remove support for 7.x agents.
- Remove python 2.7 support.
- Remove daemonization. Use nohup or systemd.


## 8.2.1
Expand Down
2 changes: 0 additions & 2 deletions agent/packaging/rpm/temboard-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \

# work directory
%{__install} -d %{buildroot}/var/lib/temboard-agent/main
# pidfile directory
%{__install} -d %{buildroot}/var/run/temboard-agent

%files
%config(noreplace) %attr(-,postgres,postgres) %{_sysconfdir}/temboard-agent
Expand Down
12 changes: 0 additions & 12 deletions agent/temboardagent/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,6 @@ def define_arguments(self, parser):
action=VersionAction,
help='show version and exit',
)
parser.add_argument(
'-d', '--daemon',
action='store_true', dest='temboard_daemonize',
help="Run in background.",
)
parser.add_argument(
'-p', '--pid-file',
action='store', dest='temboard_pidfile',
help="PID file.",
)
super().define_arguments(parser)

def init_specs(self, app_specs):
Expand Down Expand Up @@ -275,8 +265,6 @@ def list_options_specs():
# Generate each option specs.
section = 'temboard'
yield OptionSpec(section, 'ui_url', validator=v.url)
yield OptionSpec(section, 'daemonize', default=False)
yield OptionSpec(section, 'pidfile', default='/run/temboard-agent.pid')
yield OptionSpec(
section, 'address', default='0.0.0.0', validator=v.address)
yield OptionSpec(section, 'port', validator=v.port, default=2345)
Expand Down
4 changes: 0 additions & 4 deletions agent/temboardagent/cli/serve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import os

from ..daemon import daemonize
from ..plugins.monitoring import db
from ..toolkit.app import SubCommand
from ..toolkit.services import ServicesManager
Expand Down Expand Up @@ -32,9 +31,6 @@ def main(self, args):
self.app.discover.refresh()
self.app.discover.write()

if self.app.config.temboard.daemonize:
daemonize(self.app.config.temboard.pidfile)

self.app.httpd.services = services = ServicesManager()
services.add(self.app.worker_pool)
services.add(self.app.scheduler)
Expand Down
89 changes: 0 additions & 89 deletions agent/temboardagent/daemon.py

This file was deleted.

13 changes: 0 additions & 13 deletions ui/temboardui/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@ def define_arguments(self, parser):
action=VersionAction,
help='show version and exit',
)
parser.add_argument(
'-d', '--daemon',
action='store_true', dest='temboard_daemonize',
help="Run in background.",
)
parser.add_argument(
'-p', '--pid-file',
action='store', dest='temboard_pidfile',
help="PID file.", metavar='PIDFILE',
)

# Chain up for sub-commands arguments initialization.
super().define_arguments(parser)

Expand Down Expand Up @@ -398,8 +387,6 @@ def list_options_specs():
default=TemboardApplication.DEFAULT_PLUGINS,
validator=v.jsonlist,
)
yield OptionSpec(s, 'daemonize', default=False)
yield OptionSpec(s, 'pidfile', default='/run/temboard.pid')
yield OptionSpec(s, 'address', default='0.0.0.0', validator=v.address)
yield OptionSpec(s, 'port', validator=v.port, default=8888)
yield OptionSpec(s, 'ssl_cert_file', default=None, validator=v.file_)
Expand Down
5 changes: 0 additions & 5 deletions ui/temboardui/cli/serve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ..daemon import daemonize
from ..model import check_schema
from ..toolkit.app import SubCommand
from ..toolkit.services import ServicesManager
Expand All @@ -20,9 +19,5 @@ def main(self, args):
services.add(self.app.worker_pool)
services.add(self.app.scheduler)

# Run temboard as a background daemon.
if self.app.config.temboard.daemonize:
daemonize(self.app.config.temboard.pidfile, self.app.config)

with self.app.webservice.services:
self.app.webservice.run()
5 changes: 0 additions & 5 deletions ui/temboardui/cli/web.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ..daemon import daemonize
from ..model import check_schema
from ..toolkit.app import SubCommand
from .app import app
Expand All @@ -16,8 +15,4 @@ class web(SubCommand):
def main(self, args):
check_schema()
self.app.config.load_signing_key()

if self.app.config.temboard.daemonize:
daemonize(self.app.config.temboard.pidfile, self.app.config)

self.app.webservice.run()
90 changes: 0 additions & 90 deletions ui/temboardui/daemon.py

This file was deleted.

0 comments on commit eef3510

Please sign in to comment.