| 1234567891011121314151617181920212223242526272829303132333435 |
- #!/sbin/openrc-run
- # Copyright 1999-2022 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" \
- 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 -- -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 $?
- }
|