1
0
forked from finn/tinyboard

attempt service fix

This commit is contained in:
2026-04-13 13:39:16 -07:00
parent d68f73525a
commit 85df138d10
2 changed files with 39 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ set -euo pipefail
TUNNEL_DIR="${TUNNEL_DIR:-$HOME/tinyboard/spoke}"
COMPOSE_FILE="${COMPOSE_FILE:-$TUNNEL_DIR/compose.yaml}"
RCLONE_REMOTE="${RCLONE_REMOTE:-brie-remote}"
MOUNT_POINT="${MOUNT_POINT:-$HOME/mnt/brie}"
MOUNT_POINT="${MOUNT_POINT:-$HOME/mnt/$RCLONE_REMOTE}"
# ------------------------------------------------------------
# Usage
@@ -99,10 +99,40 @@ EOF
# Hub actions (rclone user service)
# ------------------------------------------------------------
hub_install() {
echo "Assuming you have placed rclone-mount@.service in ~/.config/systemd/user/"
echo "Also, 'sudo loginctl enable-linger armbian' and a reboot may be necessary."
echo "If not, create it manually. Then run: systemctl --user daemon-reload"
local SERVICE_DIR="$HOME/.config/systemd/user"
local SERVICE_FILE="$SERVICE_DIR/rclone-mount@.service"
local TEMPLATE_FILE="$(dirname "$0")/hub/rclone-mount@.service"
echo "Installing rclone mount systemd user service..."
# Create service directory if it doesn't exist
mkdir -p "$SERVICE_DIR"
# Check if template exists
if [ ! -f "$TEMPLATE_FILE" ]; then
die "Service template not found at $TEMPLATE_FILE"
fi
# Copy service template
cp "$TEMPLATE_FILE" "$SERVICE_FILE"
echo "Copied service template to $SERVICE_FILE"
# Check if user linger is enabled
if ! systemctl --user is-enabled --quiet user@$(id -u).service 2>/dev/null; then
echo "WARNING: User linger may not be enabled. Run: sudo loginctl enable-linger $USER"
echo "You may need to reboot for user services to start automatically."
fi
# Reload systemd
systemctl --user daemon-reload
echo "Systemd user daemon reloaded."
echo ""
echo "Next steps:"
echo "1. Ensure /etc/fuse.conf has 'user_allow_other' uncommented"
echo "2. Ensure you're in the 'fuse' group: sudo usermod -aG fuse $USER"
echo "3. Start the service: $0 hub start"
echo "4. Enable auto-start: systemctl --user enable rclone-mount@${RCLONE_REMOTE}.service"
}
hub_start() {