From d513970f5ae782fb5e168c8e6bbed9e09b4dde96 Mon Sep 17 00:00:00 2001 From: Ronald G Minnich Date: Fri, 12 Jun 2026 07:42:31 -0700 Subject: [PATCH] Add a systemd for embedded systems with 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 --- systemd/Makefile | 7 +++++++ systemd/README.md | 7 +++++++ systemd/cpud.service | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 systemd/Makefile create mode 100644 systemd/README.md create mode 100644 systemd/cpud.service diff --git a/systemd/Makefile b/systemd/Makefile new file mode 100644 index 00000000..0bf1a121 --- /dev/null +++ b/systemd/Makefile @@ -0,0 +1,7 @@ +all: + cp cpud.service /etc/systemd/system/cpud.service + +reload: + systemctl daemon-reload + systemctl enable --now cpud + diff --git a/systemd/README.md b/systemd/README.md new file mode 100644 index 00000000..2ba23f15 --- /dev/null +++ b/systemd/README.md @@ -0,0 +1,7 @@ +This is a primitive unit file for systemd. + +For now, it is for small embedded systems, with a shared key: /key.pub. + +We welcome improvements. + + diff --git a/systemd/cpud.service b/systemd/cpud.service new file mode 100644 index 00000000..3a90e45c --- /dev/null +++ b/systemd/cpud.service @@ -0,0 +1,11 @@ +[Unit] +Description=CPU daemon +After=network.target + +[Service] +ExecStart=/usr/bin/cpud -pk /key.pub +Restart=on-failure + +[Install] +WantedBy=multi-user.target +