~dricottone/huttese-apk

ref: 805e71a735e5f39fdc85b44bffd7ff4c0bcbd7f4 huttese-apk/sr.ht/builds.sr.ht/builds.sr.ht-runner.initd -rw-r--r-- 499 bytes
805e71a7 — Drew DeVault Remove python2-dev from py-cairosvg 5 years ago
                                                                                
1702be43 Drew DeVault
57b6e806 Drew DeVault
1702be43 Drew DeVault
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/sbin/openrc-run
name="srht-runner"
description="builds.sr.ht build runner service"

depend() {
	need net
}

nproc() {
	grep "core id" /proc/cpuinfo | wc -l
}

start() {
	ebegin "Starting $name"
	start-stop-daemon --background --make-pidfile --pidfile /run/$name.pid -u builds \
		--exec /usr/bin/celery -- \
		-A buildsrht.runner worker --loglevel=info -c $(nproc)
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid
	eend $?
}