This repository has been archived on 2026-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
anvillm/services/runit/run

27 lines
730 B
Bash
Executable File

#!/bin/sh
# runit service script for anvillm
#
# To install this service:
# 1. Copy this directory to /etc/sv/anvillm
# 2. Create symlink: ln -s /etc/sv/anvillm /var/service/anvillm
#
# The service will start automatically and restart if it crashes.
exec 2>&1
# Set up environment
# Adjust these paths as needed for your system
export HOME=${HOME:-/home/$(whoami)}
export PATH="${HOME}/bin:/usr/local/bin:/usr/bin:/bin"
# Ensure namespace directory exists
export NAMESPACE="${NAMESPACE:-/tmp/ns.$(whoami)}"
mkdir -p "$NAMESPACE"
# Log service start
echo "Starting anvillm..."
# Run anvillm in foreground (don't daemonize for runit)
# The 'start' command will handle the daemon setup
exec chpst -u $(whoami) anvillm start