fakeroot-sysv
Simulate root privileges for package building
SYNOPSIS
fakeroot-sysv [options] program [arguments]
PARAMETERS
-h, --help
Display usage summary and exit.
-v, --version
Print version information and exit.
-s FILE, --state-file=FILE
Save/restore fakeroot state to/from FILE.
-l FILE, --log-file=FILE
Log file changes to FILE (implies -s FILE).
-u, --uid
Do not fake UID; use real user ID.
-i FILE
Initialize state from FILE.
DESCRIPTION
fakeroot-sysv is a utility that simulates a root environment without requiring actual superuser privileges. It achieves this by intercepting system calls related to file ownership, permissions, and other root-only operations using System V IPC mechanisms, specifically shared memory segments and semaphores.
It maintains an internal state of the filesystem hierarchy, tracking changes to ownership, modes, and timestamps as if run by root. This is particularly useful for building software packages, such as Debian or RPM, where "make install" or similar commands need to set root-owned files without actual root access.
Unlike the LD_PRELOAD-based fakeroot, the SysV version uses kernel-level IPC for communication between the fakeroot server process and client commands, making it suitable for environments where dynamic library preloading is problematic, like statically linked binaries or certain chroots. However, it requires System V IPC support in the kernel and free IPC key ranges (typically 0x666969 to 0x666970).
Common use cases include package building scripts: fakeroot-sysv debian/rules binary. State can be saved to files for reuse across invocations, and changes logged for verification.
CAVEATS
Requires kernel System V IPC support; IPC key collisions possible with multiple instances. Does not intercept all syscalls (e.g., no kernel module loading). Not suitable for setuid binaries or programs bypassing libc. Limited to 16-bit IPC keys.
EXAMPLES
fakeroot-sysv make install
fakeroot-sysv -s mystate fakeroot-sysv -i mystate configure
fakeroot-sysv -l changes.log debian/rules build
IPC KEYS
Uses keys 0x666969 (SHM), 0xfakeroot (SEM). Ensure no conflicts with other SysV IPC users.
HISTORY
Developed by Joost Witteveen in 1997 as part of the fakeroot package for Debian GNU/Linux to enable non-root package building. The SysV IPC backend added for compatibility with systems lacking reliable LD_PRELOAD support. Maintained in Debian and derivatives; latest versions integrate with modern packaging tools.


