LinuxCommandLibrary

ipcmk

Create System V inter-process communication (IPC) resources

TLDR

Create a shared memory segment

$ ipcmk --shmem [segment_size_in_bytes]
copy

Create a semaphore
$ ipcmk --semaphore [element_size]
copy

Create a message queue
$ ipcmk --queue
copy

Create a shared memory segment with specific permissions (default is 0644)
$ ipcmk --shmem [segment_size_in_bytes] [octal_permissions]
copy

SYNOPSIS

ipcmk [options] [parameters]

PARAMETERS

--message, -M
    Create a System V message queue with the size .

--semaphore, -S
    Create a System V semaphore set with semaphores.

--shmem, -m
    Create a System V shared memory segment of bytes.

--posixmq, -Q
    Create a POSIX message queue with the name .

--directory, -D
    Create a directory. Permissions are determined by --mode/--uid/--gid/--context options.

--fifo, -F
    Create a FIFO. Permissions are determined by --mode/--uid/--gid/--context options.

--socket, -N
    Create a socket. Permissions are determined by --mode/--uid/--gid/--context options.

--mode, -o
    Specify the permissions to use for the IPC resource in octal format. Only for --directory, --fifo and --socket.

--uid, -u
    Specify the user ID to use for the IPC resource. Only for --directory, --fifo and --socket.

--gid, -g
    Specify the group ID to use for the IPC resource. Only for --directory, --fifo and --socket.

--context, -t
    Specify the SELinux security context to use for the IPC resource. Only for --directory, --fifo and --socket.

--help, -h
    Display help text and exit.

--version, -V
    Display version information and exit.

DESCRIPTION

The ipcmk command is a utility used to create or alter various Inter-Process Communication (IPC) resources on Linux systems. IPC resources like shared memory segments, message queues, and semaphores enable different processes to communicate and synchronize with each other.

ipcmk provides a command-line interface for creating these resources with specific parameters. It offers fine-grained control over the creation process, allowing you to define permissions, sizes, and other relevant attributes. It can create resources with default permissions or, when appropriate, you can define the user, group and permission to be used.

Using ipcmk effectively requires understanding of IPC concepts and the specific characteristics of each IPC resource type. Incorrect configuration can lead to security vulnerabilities or application instability. Because it manipulates system resources, superuser privileges (typically through sudo) are often required.

CAVEATS

Creating IPC resources incorrectly can lead to security vulnerabilities or application instability.
Use with caution and understand the implications of the chosen parameters. Superuser privileges are often required. Insufficient privileges will result in 'permission denied' errors.

IPC RESOURCE TYPES

ipcmk supports creation of: System V message queues (--message), System V semaphore sets (--semaphore), System V shared memory segments (--shmem), POSIX message queues (--posixmq), directories (--directory), FIFOs (--fifo), and sockets (--socket). Each type has its own specific characteristics and use cases.

PERMISSIONS AND OWNERSHIP

For directories, FIFOs, and sockets, the --mode, --uid, and --gid options can be used to set the permissions and ownership of the created resource. These options are crucial for controlling access to the resource.

SEE ALSO

ipcrm(1), ipcs(1), shm_overview(7), mq_overview(7), sem_overview(7)

Copied to clipboard