Skip to content

Commit

Permalink
pdist: Add pdistd service for distmaster(s)
Browse files Browse the repository at this point in the history
To implement auto-update on boot, we need a way for a client to trigger a
pdist-update for itself on its distmaster.

Add a service for the distmaster(s), which allows a client to do that by
connecting to a fixed port on the distmaster (`telnet deinemuddah 237`).
  • Loading branch information
donald committed Jul 1, 2023
1 parent 91acf06 commit 7f1c8ee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ install_data misc_etc_files/modprobe.d/disable-i915.conf "$DESTDIR$sysconfdir/m
install_data misc_systemd_units/i915.service "$DESTDIR$systemdunitdir/i915.service"
install_data misc_systemd_units/mxstartup.service.d/fix-tmp.conf \
"$DESTDIR$systemdunitdir/mxstartup.service.d/fix-tmp.conf"
install_data pdist/pdistd.socket "$DESTDIR$systemdunitdir/pdistd.socket"
install_data pdist/pdistd@.service "$DESTDIR$systemdunitdir/pdistd@.service"

postinstall
exit
13 changes: 13 additions & 0 deletions pdist/pdistd.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]

ConditionPathExists=/node/tags/distmaster

[Socket]

ListenStream=237
ReusePort=yes
Accept=yes

[Install]

WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions pdist/pdistd@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]

CollectMode=inactive-or-failed

[Service]

StandardOutput=socket
ExecStart=bash -c "read ip host <<< $(getent hosts ${REMOTE_ADDR}) ; echo update in progess... ; pdist push $host --timeout 60 --set-pdist-status"

0 comments on commit 7f1c8ee

Please sign in to comment.