Skip to content

Add dmsystem service for ICMP echo response - #2

Merged
JohnAmadis merged 1 commit into
mainfrom
claude/icmp-service-file-mw1vcb
Sep 17, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
claude/icmp-service-file-mw1vcb

Conversation

@JohnAmadis

Copy link
Copy Markdown
Contributor

Summary

dmicmp is a Library-type DMOD module - it has no main(), so nothing
spawns it as a process on its own. It only starts answering ICMP Echo
Requests (ping) once something calls dmod_init() by loading it, which
today requires a manual step. This adds a
dmsystem/libsystemd
service so ping response can be turned on (and off) declaratively:

  • configs/icmp.ini - a libsystemd unit (type=oneshot, exec=dmell)
    that loads dmicmp at boot.
  • configs/icmp-start.dme - the dmell script it runs: module load dmicmp.
  • configs/icmp-stop.dme - companion script, module unload dmicmp, to
    stop answering pings. Not wired as an "ExecStop" - libsystemd has no
    such key yet - so it's run directly instead.
  • docs/service.md - full rationale: why a Library module needs a script
    instead of exec=dmicmp directly, why type=oneshot, and why there's
    no service stop icmp.
  • dmicmp.dmr gets a configs= entry so configs/ is installed
    alongside the module (mirrors the dmtty/tools/console convention for
    shipping a unit file next to its module).
  • README/docs index updates pointing at the new service.

This establishes the first .dme-as-exec= unit in the DMOD ecosystem
(researched across the other module repos - nothing else uses this
pattern yet, though dmtty/tools/console established the
configs/<unit>.ini + .dmr install convention this mirrors).

Test plan

  • No C/CMake changes - configs//docs/ are data files only, build
    unaffected.
  • Manual: install dmicmp, drop configs/icmp.ini into a libsystemd
    units directory (with args= pointed at the installed
    icmp-start.dme), boot systemd, confirm the device answers ping;
    run icmp-stop.dme and confirm it stops.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XcEbAA3VGWGpAoM2pMeTkv


Generated by Claude Code

dmicmp is a Library-type module with no main() of its own, so nothing
spawns it automatically - dmod_init() (where it registers with dmip and
starts answering pings) only runs once something loads it. Add
configs/icmp.ini, a dmsystem/libsystemd unit that loads dmicmp at boot
via a dmell script (configs/icmp-start.dme, module load dmicmp), plus a
companion configs/icmp-stop.dme (module unload dmicmp) to stop
answering pings, since libsystemd has no ExecStop-style key yet. See
docs/service.md for the full rationale.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XcEbAA3VGWGpAoM2pMeTkv
@JohnAmadis
JohnAmadis merged commit 571271f into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants