Skip to content

Add a systemd for embedded systems with one user#326

Open
rminnich wants to merge 1 commit into
u-root:mainfrom
rminnich:systemd
Open

Add a systemd for embedded systems with one user#326
rminnich wants to merge 1 commit into
u-root:mainfrom
rminnich:systemd

Conversation

@rminnich

Copy link
Copy Markdown
Member

This is a dead simple systemd unit file, that assumes cpud is in root's $PATH, and a key in /key.pub.

It's really for basic use with small boards that have one user.

This is a dead simple systemd unit file, that assumes
cpud is in root's $PATH, and a key in /key.pub.

It's really for basic use with small boards that have
one user.

Signed-off-by: Ronald G Minnich <rminnich@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a minimal systemd unit + install helper intended for simple embedded deployments where cpud runs as root and authenticates via a single shared public key.

Changes:

  • Added systemd/cpud.service unit to run cpud at boot with a fixed public key path.
  • Added a systemd/Makefile to install the unit and enable/reload it.
  • Added a short systemd/README.md describing the intent and assumptions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
systemd/README.md Documents the intended “primitive” embedded usage and key location assumption.
systemd/Makefile Provides targets to install the unit and enable/reload systemd.
systemd/cpud.service Defines the systemd service for running cpud on boot.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread systemd/README.md

For now, it is for small embedded systems, with a shared key: /key.pub.

We welcome improvements.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ironic. =)

Comment thread systemd/Makefile
Comment on lines +1 to +7
all:
cp cpud.service /etc/systemd/system/cpud.service

reload:
systemctl daemon-reload
systemctl enable --now cpud

Comment thread systemd/cpud.service
Comment on lines +6 to +7
ExecStart=/usr/bin/cpud -pk /key.pub
Restart=on-failure

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is likely just pkg-ed in initramfs per PR description ("small embedded system"), so the bot seems to have hallucinated that this is a regular go cmd to be go install-ed (?)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the env part seems like it's assuming a regular distro that has /usr/bin/env, which u-root might not have. btw, i think this might not be for u-root either. from talking with ron on the side, i thought this was just some random distribution.

that said, it's not wrong about the discrepancy between saying "cpud just needs to be in $PATH" and hardcoding /usr/bin/cpud.

systemd requires absolute paths (i think), so you have to make some assumption: either about the existence of /usr/bin/env or the location of cpud. either way is fine with me.

@rminnich rminnich requested a review from brho June 12, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants