Use start-stop-daemon instead of supervisord, add optdepends to mysql & postgresql

This commit is contained in:
LinuxSquare 2025-05-31 10:31:45 +02:00
parent 11af7ebbf9
commit 9adc952640
2 changed files with 38 additions and 5 deletions

View file

@ -1,12 +1,13 @@
pkgname="semaphore-bin"
pkgver=2.14.12
pkgrel=4
pkgrel=5
pkgdesc="Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools."
url="https://semaphoreui.com"
license="MIT"
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-install"
arch="x86_64"
_arch="amd64"
optdepends="mariadb postgresql"
source="
$pkgname-$pkgver.tar.gz::https://github.com/semaphoreui/semaphore/releases/download/v${pkgver}/semaphore_${pkgver}_linux_${_arch}.tar.gz
semaphore.initd

View file

@ -1,8 +1,40 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
name="semaphore"
description="Semaphore Service"
supervisor="supervise-daemon"
command="/usr/bin/semaphore server"
command_args="config /var/lib/semaphore/config.json"
command="/usr/bin/semaphore"
command_args="server --config /var/lib/semaphore/config.json"
command_user="semaphore"
pidfile="/run/semaphore.pid"
depend() {
need net
after firewall
}
start_pre() {
checkpath -d -m 0755 -o semaphore:semaphore /run
checkpath -d -m 0755 -o semaphore:semaphore /var/log/semaphore
}
start() {
ebegin "Starting ${RC_SVCNAME}"
start-stop-daemon -v --start \
-1 /var/log/semaphore/current.log \
-2 /var/log/semaphore/error.log \
--user ${command_user} \
--exec ${command} \
--pidfile ${pidfile} \
--make-pidfile \
--background \
-- ${command_args}
eend $?
}
stop() {
ebegin "Stopping ${RC_SVCNAME}"
start-stop-daemon --stop \
--pidfile ${pidfile} \
--retry TERM/30/KILL/5
eend $?
}