diff options
Diffstat (limited to 'dendrite/files/rc.dendrite.new')
-rw-r--r-- | dendrite/files/rc.dendrite.new | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/dendrite/files/rc.dendrite.new b/dendrite/files/rc.dendrite.new new file mode 100644 index 0000000..1112c81 --- /dev/null +++ b/dendrite/files/rc.dendrite.new @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Startup/shutdown script for the matrix Dendrite service. +# + +create_run_dir() { + if [ ! -d /run/dendrite/ ]; then + mkdir -p /run/dendrite + chown :dendrite /run/dendrite + chmod g+wX /run/dendrite + fi +} + +start() { + echo "Starting matrix Dendrite service" + create_run_dir + + daemon \ + --chdir=/var/lib/dendrite \ + --name=dendrite \ + --pidfiles=/run/dendrite \ + --user=dendrite \ + -- dendrite -config /etc/dendrite/dendrite.yaml +} + +status() { + create_run_dir + + /usr/bin/daemon --name=dendrite --pidfiles=/run/dendrite --running --verbose +} + +stop() { + echo "Stopping matrix Dendrite service" + create_run_dir + + /usr/bin/daemon --name=dendrite --pidfiles=/run/dendrite --stop +} + +case "$1" in +start) + start + ;; +status) + status + ;; +stop) + stop + ;; +*) + echo "Usage: $0 {start|stop|status}" + exit 1 +esac + |