mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 22:57:59 -05:00
38 lines
943 B
Plaintext
38 lines
943 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2023 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
depend() {
|
|
use net
|
|
}
|
|
|
|
start() {
|
|
PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"
|
|
|
|
ebegin "Starting lilith"
|
|
env TERM="xterm" DARKFI_LOG="/tmp/lilith.log" LOG_TARGETS="!MessageSubsystem::notify" \
|
|
start-stop-daemon \
|
|
--start \
|
|
--make-pidfile \
|
|
--pidfile /var/run/lilith.pid \
|
|
--background \
|
|
--user $USER \
|
|
--env HOME="${PWHOME:-/home/$USER}" \
|
|
--name lilith \
|
|
--exec /usr/bin/screen -- \
|
|
-L -Logfile /home/lilith/screenlog.0 \
|
|
-d -m -S lilith /usr/local/bin/lilith
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping lilith"
|
|
# Because we've daemonized with screen, we need to replace the PID file
|
|
# with the real PID of the program
|
|
pgrep -P $(cat /var/run/lilith.pid) > /var/run/lilith.pid
|
|
|
|
start-stop-daemon --stop --signal 15 \
|
|
--pidfile /var/run/lilith.pid
|
|
eend $?
|
|
}
|