Use start-stop-daemon instead of supervisord, add optdepends to mysql & postgresql
This commit is contained in:
parent
11af7ebbf9
commit
9adc952640
2 changed files with 38 additions and 5 deletions
3
APKBUILD
3
APKBUILD
|
@ -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
|
||||
|
|
|
@ -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 $?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue