Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ declare -A services
declare -A secrets

# FIXME: Make services setup their own DB ... Will need for not Self-host
# FIXME: If we are doing non-rootful containers, should be check to make sure the user's systemd session is in linger mode?

# FIXME: I should be using this I think??
quadlet_dir="$HOME/.config/containers/systemd"
Expand Down Expand Up @@ -202,6 +201,24 @@ if ! command -v "podman" &> /dev/null; then
exit 1
fi

# Check if linger is enabled for the current user
if ! loginctl show-user "$USER" | grep -q "Linger=yes"; then
echo -e "${YELLOW}Linger mode is not enabled for user ${BOLD}$USER${NOBOLD}.${NC}"
echo -e "${CYAN}Linger is required to allow user services to start at boot.${NC}"

if ask_yes_no "Would you like to enable linger mode now (requires sudo)?" "y"; then
if sudo loginctl enable-linger "$USER"; then
echo -e "${GREEN}Linger mode enabled for ${BOLD}$USER${NOBOLD}.${NC}"
else
echo -e "${RED}Failed to enable linger mode. Please try manually: sudo loginctl enable-linger $USER${NC}"
exit 1
fi
else
echo -e "${RED}Linger mode is required. Exiting.${NC}"
exit 1
fi
fi

###
### SPRING
###
Expand Down