summaryrefslogtreecommitdiff
path: root/app-misc/uptimed/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-misc/uptimed/files
reinit the tree, so we can have metadata
Diffstat (limited to 'app-misc/uptimed/files')
-rw-r--r--app-misc/uptimed/files/uptimed.init-r118
-rw-r--r--app-misc/uptimed/files/uptimed.service10
2 files changed, 28 insertions, 0 deletions
diff --git a/app-misc/uptimed/files/uptimed.init-r1 b/app-misc/uptimed/files/uptimed.init-r1
new file mode 100644
index 000000000000..96564d8ee541
--- /dev/null
+++ b/app-misc/uptimed/files/uptimed.init-r1
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="uptimed - a daemon to record uptime records"
+pidfile="/run/uptimed.pid"
+command="/usr/sbin/uptimed"
+command_user="uptimed"
+
+# The uptimed daemon can create its own PID file, but it doesn't know
+# how to drop privileges. On the other hand, if we run it as a
+# restricted user under start-stop-daemon, the PID file it creates
+# will therefore be owned by a non-root user, and that poses a
+# security risk. To avoid the issue entirely, we run the daemon in the
+# foreground, and then use command_background=true to let OpenRC
+# handle the PID file.
+command_args="-f"
+command_background="true"
diff --git a/app-misc/uptimed/files/uptimed.service b/app-misc/uptimed/files/uptimed.service
new file mode 100644
index 000000000000..531c41570216
--- /dev/null
+++ b/app-misc/uptimed/files/uptimed.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Uptime record tracking daemon
+Documentation=man:uptimed(8) man:uprecords(1)
+
+[Service]
+ExecStartPre=/usr/sbin/uptimed -b
+ExecStart=/usr/sbin/uptimed -f
+
+[Install]
+WantedBy=multi-user.target