diff --git a/Service-files.md b/Service-files.md index 23d2bf4..1482676 100644 --- a/Service-files.md +++ b/Service-files.md @@ -1,18 +1,20 @@ -A sample systemd to run matterbridge in the background, restarting if necessary. +# systemd + +A sample systemd unit to run matterbridge in the background, restarting if necessary. /lib/systemd/system/matterbridge.service -``` +```dosini [Unit] Description=Matterbridge Server After=network.target [Service] Type=notify -ExecStart=/opt/mattermost/matterbridge-1.21.0/matterbridge -debug -conf matterbridge.toml +ExecStart=/opt/mattermost/matterbridge-1.24.0/matterbridge -debug -conf matterbridge.toml TimeoutStartSec=3600 Restart=always RestartSec=10 -WorkingDirectory=/opt/mattermost/matterbridge-1.21.0 +WorkingDirectory=/opt/mattermost/matterbridge-1.24.0 User=mattermost Group=mattermost LimitNOFILE=49152 @@ -22,8 +24,32 @@ WantedBy=multi-user.target ``` Reload systemd with `sudo systemctl daemon-reload` -Enable with `sudo systemctl enable matterbridge.` +Enable with `sudo systemctl enable matterbridge` Start with `sudo systemctl start matterbridge` -Created by Minecraftchest1 \ No newline at end of file +Created by Minecraftchest1 + +# OpenRC + +A sample OpenRC service to run matterbridge in the background. + +/etc/init.d/matterbridge +```sh +#!/sbin/openrc-run +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command=/usr/bin/matterbridge +command_args="-conf ${MATTERBRIDGE_CONF:-/etc/matterbridge/matterbridge.toml} ${MATTERBRIDGE_ARGS}" +command_user="mattermost:mattermost" +pidfile="/run/${RC_SVCNAME}.pid" +command_background=1 + +depend() { + need net +} +``` +Enable with `sudo rc-update add matterbridge default` + +Start with `sudo rc-service matterbridge start` \ No newline at end of file