net-proxy/yass: add 1.11.3, drop 1.11.2-r2
[gentoo-zh.git] / net-proxy / dae / files / dae.initd
blobba6f523a3dd821b25def8005e6a38214a85ffa6c
1 #!/sbin/openrc-run
2 # Copyright 2023 Gentoo Authors
3 # Distributed under the terms of the GNU General Public License v2
5 description="dae Service"
6 pidfile="/run/${RC_SVCNAME}.pid"
7 command="/usr/bin/dae"
8 command_args="run -c ${DAE_CONF_DIR:-/etc/dae}/config.dae"
9 command_background="yes"
11 rc_ulimit="${DAE_ULIMIT:--u 512 -n 1048576}"
12 output_log="/var/log/dae.log"
13 error_log="/var/log/dae.log"
15 depend() {
16     after docker net net-online sysctl local
17     use net
20 start_pre() {
21     if [ -d /sys/fs/bpf ]; then
22         if ! mountinfo -q /sys/fs/bpf ; then
23             mount -t bpf bpffs /sys/fs/bpf
24         fi
25     else
26         eerror "bpf filesystem not mounted, exiting..."
27         return 1
28     fi
30     if [ -d /sys/fs/cgroup ] && ! mountinfo -q /sys/fs/cgroup/; then
31         eerror "cgroup filesystem not mounted, exiting..."
32         return 1
33     fi
35     if ! /usr/bin/dae validate -c /etc/dae/config.dae; then
36         eerror "checking config file /etc/dae/config.dae failed, exiting..."
37         return 1
38     fi
40     checkpath -d -m 0755 /run/${RC_SVCNAME}
41     checkpath -f -m 0644 "$output_log"