Next: , Previous: , Up: binfmt   [Index]


I.5 Controlling the mechanism

Overall control

We can enable/disable the mechanism by echoing 0 (to disable) or 1 (to enable) to the special file:

/proc/sys/fs/binfmt_misc/status

that is, at the shell prompt and with superuser privileges, to enable:

# echo 1 >/proc/sys/fs/binfmt_misc/status

and to disable:

# echo 0 >/proc/sys/fs/binfmt_misc/status

Applying the command cat to the status special file tells us the current status of binfmt_misc:

$ cat /proc/sys/fs/binfmt_misc/status
enabled

We can remove all the entries from the registry echoing -1 to status; at the shell prompt and with superuser privileges:

# echo -1 >/proc/sys/fs/binfmt_misc/status

removing the entries and disabling the mechanism are two distinct operations.

Specific format control

We can enable/disable recognition of a single binary format by echoing 0 or 1 to the format specific special file under /proc/sys/fs/binfmt_misc. For example for VICARE_SCRIPTS, at the shell prompt and with superuser privileges, to enable:

$ echo 1 >/proc/sys/fs/binfmt_misc/VICARE_SCRIPTS

and to disable:

$ echo 0 >/proc/sys/fs/binfmt_misc/VICARE_SCRIPTS

disabled formats are not removed from the internal table.

Applying the command cat to the format’s special file tells us the current status of that format and its configuration; for example for VICARE_SCRIPTS, at the shell prompt:

$ cat /proc/sys/fs/binfmt_misc/VICARE_SCRIPTS

We can remove a specific format entry from the registry echoing -1 to its special file; for VICARE_SCRIPTS at the shell prompt and with superuser privileges:

$ echo -1 >/proc/sys/fs/binfmt_misc/VICARE_SCRIPTS

removing the entry and disabling the mechanism for a format are two distinct operations.


Next: , Previous: , Up: binfmt   [Index]