Skip to content

Can't execute binaries inside the AppImage (when mounted) with sudo #146

@jviotti

Description

@jviotti

Hi, we're having a strange issue over here at Etcher, an image writer: executing any command as sudo from the AppImage once its mounted outputs command not found. The executable indeed has execution permissions for everyone, and it can be executed normally without sudo.

Maybe this is the expected AppImages behaviour but let me share our use case: The entry point of our desktop application makes the app execute as a desktop app or a CLI tool depending on the value of an environment variable, which is ELECTRON_RUN_AS_NODE. The actual writing functionality is implemented in the CLI version, the GUI forks itself with ELECTRON_RUN_AS_NODE=1 (causing the CLI to run as a child process) and the CLI version emits state information back to the parent.

Since writing to devices requires elevated privileges, the GUI forks itself using gksudo, pkexec or kdesudo, depending on what's found on the client's machine, however we get the above mentioned error when forking the AppImage entry point as sudo.

Is there a way to workaround this limitation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions