mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
`serve service install` copied the caller's PATH into the systemd unit or LaunchAgent. Run from the AppImage, that PATH starts with the launch's temporary /tmp/.mount_* directory (and $APPDIR/usr/sbin), which is gone by the service's next start; another process's mount could later take the same name. The unit PATH now drops every directory the service command lookup already refuses as tied to one Orca version or AppImage launch: profile and orcad artifact dirs, the AppImage FUSE mount, and extract-and-run copies (appimage_extracted_*), plus relative entries. AppImage mount detection now lives in one shared helper used by the service command check, the unit PATH and the daemon host-image probe; the command check previously missed extract-and-run copies. Fixes #36000
17 lines
702 B
TypeScript
17 lines
702 B
TypeScript
export type AppImageEphemeralRoot = { kind: 'mount' | 'extract'; path: string }
|
|
|
|
/** The AppImage runtime's per-launch FUSE mount or extract-and-run copy holding path; both vanish with that launch. */
|
|
export function appImageEphemeralRootOf(path: string): AppImageEphemeralRoot | null {
|
|
const segments = path.split('/')
|
|
for (let index = 1; index < segments.length; index += 1) {
|
|
const segment = segments[index]!
|
|
if (segment.startsWith('.mount_')) {
|
|
return { kind: 'mount', path: segments.slice(0, index + 1).join('/') }
|
|
}
|
|
if (segment.startsWith('appimage_extracted_')) {
|
|
return { kind: 'extract', path: segments.slice(0, index + 1).join('/') }
|
|
}
|
|
}
|
|
return null
|
|
}
|