Next: , Previous: binfmt using, Up: binfmt


G.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, at the shell prompt and with superuser privileges, to enable:

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

and to disable:

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

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, at the shell prompt:

     $ cat /proc/sys/fs/binfmt_misc/VICARE

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

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

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