aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/install.sh
blob: 0a118b7301b07bb05c43d549d059cce2d8655290 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Install & enable the idatui-mcp user service. Re-run after editing the unit.
set -eu

UNIT=idatui-mcp.service
SRC=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/$UNIT
DEST_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"

mkdir -p "$DEST_DIR"
ln -sf "$SRC" "$DEST_DIR/$UNIT"

# Keep the service alive after logout / across reboots without a login session.
loginctl enable-linger "$(id -un)" || true

systemctl --user daemon-reload
systemctl --user enable --now "$UNIT"

echo
echo "Installed. Handy commands:"
echo "  systemctl --user status  idatui-mcp"
echo "  systemctl --user restart idatui-mcp"
echo "  journalctl --user -u idatui-mcp -f"
echo "  systemctl --user edit    idatui-mcp   # drop-in overrides (ports, workers)"