diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/main.go | 6 | ||||
-rw-r--r-- | systemd/birdscan.service | 13 | ||||
-rw-r--r-- | systemd/birdscan.sysusers | 1 |
4 files changed, 19 insertions, 3 deletions
@@ -16,4 +16,6 @@ clean: install: all make -C python install DESTDIR=$(abspath $(DESTDIR)) make -C src install DESTDIR=$(abspath $(DESTDIR)) + install -Dm 644 systemd/birdscan.service $(DESTDIR)$(PREFIX)/lib/systemd/system/birdscan.service + install -Dm 644 systemd/birdscan.sysusers $(DESTDIR)$(PREFIX)/lib/sysusers.d/birdscan.conf diff --git a/src/main.go b/src/main.go index 6e413c8..7b693ee 100644 --- a/src/main.go +++ b/src/main.go @@ -3,14 +3,14 @@ package main import ( - "fmt" + "log" "time" ) func main() { + log.Println("Starting birdscan") for { - fmt.Println("Hey!") - time.Sleep(2 * time.Second) + time.Sleep(1 * time.Second) } } diff --git a/systemd/birdscan.service b/systemd/birdscan.service new file mode 100644 index 0000000..aa9f319 --- /dev/null +++ b/systemd/birdscan.service @@ -0,0 +1,13 @@ + +[Unit] +Description=A software to take nice pictures of birds with a Raspberry Pi Camera +After=network.target + +[Service] +User=birdscan +Group=birdscan +ExecStart=/usr/bin/birdscan + +[Install] +WantedBy=multi-user.target + diff --git a/systemd/birdscan.sysusers b/systemd/birdscan.sysusers new file mode 100644 index 0000000..c84ccd2 --- /dev/null +++ b/systemd/birdscan.sysusers @@ -0,0 +1 @@ +u birdscan - "birdscan daemon user" - /bin/bash |