summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2021-04-04 01:54:18 -0700
committerZac Medico <zmedico@gentoo.org>2021-04-04 02:53:28 -0700
commit7d7a58c735e75e77a26149e237979f6fcd968d9d (patch)
tree019ecb1822f1a8f537428345a583718fc2f5e151 /sys-cluster/gmqtt/files
parentgames-util/ucon64: port to EAPI 7, eutils-- (diff)
downloadgentoo-7d7a58c735e75e77a26149e237979f6fcd968d9d.tar.gz
gentoo-7d7a58c735e75e77a26149e237979f6fcd968d9d.tar.bz2
gentoo-7d7a58c735e75e77a26149e237979f6fcd968d9d.zip
sys-cluster/gmqtt: Initial import
Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'sys-cluster/gmqtt/files')
-rw-r--r--sys-cluster/gmqtt/files/confd1
-rw-r--r--sys-cluster/gmqtt/files/gmqttd.service14
-rw-r--r--sys-cluster/gmqtt/files/initd26
-rw-r--r--sys-cluster/gmqtt/files/logrotated3
4 files changed, 44 insertions, 0 deletions
diff --git a/sys-cluster/gmqtt/files/confd b/sys-cluster/gmqtt/files/confd
new file mode 100644
index 000000000000..5b25df933eed
--- /dev/null
+++ b/sys-cluster/gmqtt/files/confd
@@ -0,0 +1 @@
+GMQTTD_OPTS="-c /etc/gmqtt/gmqttd.yml start"
diff --git a/sys-cluster/gmqtt/files/gmqttd.service b/sys-cluster/gmqtt/files/gmqttd.service
new file mode 100644
index 000000000000..3c90faedba3c
--- /dev/null
+++ b/sys-cluster/gmqtt/files/gmqttd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Gmqtt Broker Service
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+Environment=GMQTTD_OPTS="-c /etc/gmqtt/gmqttd.yml start"
+Restart=on-failure
+RestartSec=5s
+ExecStart=/usr/bin/gmqttd $GMQTTD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-cluster/gmqtt/files/initd b/sys-cluster/gmqtt/files/initd
new file mode 100644
index 000000000000..9285f0d59a81
--- /dev/null
+++ b/sys-cluster/gmqtt/files/initd
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+
+description="Gmqtt Broker Service"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+command="/usr/bin/gmqttd"
+command_user="nobody:nobody"
+command_args="${GMQTTD_OPTS=:-"-c /etc/gmqtt/gmqttd.yml start"}"
+command_background="true"
+logfile=/var/log/gmqtt/${RC_SVCNAME}.log
+start_stop_daemon_args="--user ${command_user%:*} --group ${command_user#*:}
+ --stdout ${logfile} --stderr ${logfile}"
+
+: "${supervisor:=supervise-daemon}"
+: "${respawn_delay:=5}"
+: "${respawn_max:=10}"
+: "${respawn_period:=60}"
+
+depend() {
+ need net
+}
+
+start() {
+ checkpath --directory --mode 755 --owner root "${pidfile%/*}"
+ checkpath --directory --mode 755 --owner "${command_user}" "${logfile%/*}"
+ default_start
+}
diff --git a/sys-cluster/gmqtt/files/logrotated b/sys-cluster/gmqtt/files/logrotated
new file mode 100644
index 000000000000..4b84aa11f977
--- /dev/null
+++ b/sys-cluster/gmqtt/files/logrotated
@@ -0,0 +1,3 @@
+/var/log/gmqtt/*.log {
+ copytruncate
+}