Skip to content

Instantly share code, notes, and snippets.

@peterldowns
Created April 30, 2023 13:13
Show Gist options
  • Save peterldowns/c0d1f7d7a966447b566facd78fa3e408 to your computer and use it in GitHub Desktop.
Save peterldowns/c0d1f7d7a966447b566facd78fa3e408 to your computer and use it in GitHub Desktop.
wsl2 service config for lorri daemon
#!/bin/bash
# Put this at /etc/init.d/lorri
# then you can do
#
# service lorri start
# service lorri status
# service lorri stop
# service lorri restart
#
# as a regular user
start() {
echo "starting lorri"
# Your username is necessary for some reason
USER=pd lorri daemon &>/var/log/lorri/lorri.log &
}
stop() {
echo "stopping lorri"
pkill lorri
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
ps aux | grep lorri | grep -v grep | grep -v status
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment