Skip to content

Conversation

husixu1
Copy link

@husixu1 husixu1 commented Aug 31, 2025

Changes Overview

  1. Added fusefs_ll_op_init_override() as sqfs's init hook and fork inside there to make the payload child of the fuse process. Mount is guaranteed before sqfs_ll_ops.init is called, therefore there's no need to use keepalive_pipe for synchronization.

  2. Removed fuse_daemonize() and the fuse_mounted() pipe-based sync logic, made FUSE run in foreground (with the -f flag). Since now the payload is the child of fuse instead of the main process, there's no reason to daemonize the fuse process. This better matches a regular application's behavior: stays in foreground when invoked, and uses tty for user interaction.

  3. Parent process now waits on the payload (childpid) and directly returns its exit code or signal status. Exit code relating to signals like SIGINT and SIGTERM are handled by separately.

  4. This PR potentially also solves AppImage not unmounting when running as systemd service #99. Tests with my own AppImages run as systemd services show resolved hanging behavior. However I'm not sure whether it applies to all other AppImages used as systemd service.

Here's a minimal AppRun for verifying its behavior:

#!/bin/bash
IFS='' read -p "How many secs to sleep? " -r time
sleep "${time:-5}"
echo "${time:-5} secs passed, wakeup!"
exit 111

@husixu1 husixu1 changed the title Refactor startup process (#90) Refactor startup process (Fixing #90) Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant