Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions meta-houseos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ local_conf_header:
USER_dev[home] = "/var/lib/dev"
USER_dev[comment] = "dev user"
USER_dev[flags] = "system create-home"
USERS += "kvsd"
USER_kvsd[home] = "/var/lib/kvsd"
USER_kvsd[comment] = "kvsd user"
USER_kvsd[flags] = "system create-home"
USERS += "pihole"
USER_pihole[home] = "/var/lib/pihole"
USER_pihole[comment] = "pihole user"
Expand Down
6 changes: 6 additions & 0 deletions recipes-core/images/house-os-core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ IMAGE_INSTALL += "kvs"

# Secure Control Protocol Client
IMAGE_INSTALL += "scp-client"

# Services
IMAGE_INSTALL += "houseos-services"

# SSH Login
IMAGE_INSTALL += "sshd-regen-keys"
14 changes: 14 additions & 0 deletions recipes-houseos/houseos-services/files/kvsd-dir.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Key Value Store Daemon Store directory creation
Documentation=https://github.com/houseos/kvs

[Service]
Type=simple
ExecStartPre=mkdir -p /mnt/data/kvsd
ExecStart=chown -c kvsd /mnt/data/kvsd
StandardOutput=null
Restart=always
After=mnt-data.mount

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions recipes-houseos/houseos-services/files/kvsd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Key Value Store Daemon
Documentation=https://github.com/houseos/kvs

[Service]
User=kvsd
Type=simple
ExecStart=/usr/bin/kvsd --ip 127.0.0.1 --port 27001 --path /mnt/data/kvsd/ --backend file
StandardOutput=null
Restart=always
After=kvsd-dir.service

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions recipes-houseos/houseos-services/files/mnt-data.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Data mount service unit

[Mount]
Type=ext4
What=/dev/sda5
Where=/mnt/data

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions recipes-houseos/houseos-services/files/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Enable systemd units
systemctl enable /usr/lib/systemd/user/kvsd.service
systemctl enable /usr/lib/systemd/user/kvsd-dir.service
systemctl enable /usr/lib/systemd/user/mnt-data.mount

systemctl daemon-reload
22 changes: 22 additions & 0 deletions recipes-houseos/houseos-services/houseos-services_0.1.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ISAR Recipe for the HouseOS Services
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Benjamin Schilling

DESCRIPTION = "houseos-services"
MAINTAINER = "Benjamin Schilling <benjamin.schilling33@gmail.com>"

inherit dpkg-raw

DEBIAN_DEPENDS += "systemd, kvs"

SRC_URI = "file://kvsd.service \
file://kvsd-dir.service \
file://mnt-data.mount \
file://postinst"

do_install() {
install -v -d ${D}/usr/lib/systemd/user
install -v -m 644 ${WORKDIR}/kvsd.service ${D}/usr/lib/systemd/user/kvsd.service
install -v -m 644 ${WORKDIR}/kvsd-dir.service ${D}/usr/lib/systemd/user/kvsd-dir.service
install -v -m 644 ${WORKDIR}/mnt-data.mount ${D}/usr/lib/systemd/user/mnt-data.mount
}