Skip to content

rust-italia/mdev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdev

mdev daemon workalike, written in pure rust

mdev and mdevd are uevent managers, they listen for kernel object userspace events and react according to a set of rules that are coded in their mdev.conf format.

Structure and components

Any uevent manager daemon has 4 primary components:

  • A netlink listener, in our case netlink-sys provides us already some level of abstraction
  • Something that parses the messages encoded in the netlink packets
  • A set of rules on how to react to the events, we use the same mdev.conf format
  • The actual code that reacts to the events according to the rules
    • It matches events with rules
    • [] It executes the actual action and make sure to log the results of it
┌─────────┐                 ┌───────────┐
│ Linux   │ Uevent Packets  │ Netlink   │    UEvents
│  Kernel ├────────────────►│  Listener ├─────────────────┐
│         │                 │           │                 ▼
└─────────┘                 └───────────┘            ┌──────────┐
                                                     │ UEvent   │
                                                     │  Daemon  │
┌───────────┐               ┌───────────┐            └───────┬──┘
│ mdev.conf │ mdev lines    │ Rules     │                 ▲  │
│           ├──────────────►│  Parser   ├─────────────────┘  │
│           │               │           │   Rules            │
└───────────┘               └───────────┘                    ▼
                                                    ┌────────────┐
                                                    │ Actions    │
                                                    └────────────┘

About

mdev daemon workalike, written in pure rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages