Skip to content

Commit

Permalink
upgrade fate to add systemd integration and add netrics-specific conf…
Browse files Browse the repository at this point in the history
…ig template
  • Loading branch information
jesteria committed May 4, 2023
1 parent 022ebf6 commit a890d4a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [{include = "netrics", from = "src"}]

[tool.poetry.dependencies]
python = "^3.8"
fate-scheduler = "0.1.0-rc.11"
fate-scheduler = "0.1.0-rc.12"
netifaces = "^0.11.0"

[tool.poetry.dev-dependencies]
Expand Down
49 changes: 49 additions & 0 deletions src/netrics/sys/platform/include/systemd/netrics.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[Unit]
Description={{ label }} controller service

#
# Would also make sense to have path files s.t. (re)-loaded IFF these are modified.
#
# https://manpages.debian.org/stretch/systemd/systemd.path.5.en.html
#
# ConditionPathExistsGlob=…/tasks.*
# ConditionPathExistsGlob=…/defaults.*
#

StartLimitIntervalSec=1
StartLimitBurst=1


[Service]
Environment=PATH="{{ env_path }}"

ExecStart="{{ install_path }}"/netrics.d --foreground

#
# Eventually:
#
# * will want to handle kill gracefully...
# * ...and hup or whatever to reload configuration
# * ...and perhaps here can indicate that certain paths (config) are watched for changes to trigger reload
#
# Might also set an exec condition that config exists (for generic Fate anyway).
#

Restart=on-failure

#
# Might be useful here...
#
# ...Or might be annoying with permissions; (perhaps will want to set user in conf instead).
#
# User=netrics
#


[Install]
#
# Start service based on assignment of (local) IP address
#
# (I.e. don't bother with WAN tests if we're not yet connected to LAN.)
#
WantedBy=network-online.target

0 comments on commit a890d4a

Please sign in to comment.