You are not logged in.

#1 2024-02-03 10:40:32

tomri
Member
Registered: 2023-12-16
Posts: 8

How to respond to kernel events with custom scripts (hooks)

`journatlctl -r` throwed me this:
```
Feb 03 15:57:54 arch kernel: usb 3-1: USB disconnect, device number 42
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] Attached SCSI removable disk
Feb 03 15:57:52 arch kernel:  sda: sda1
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] No Caching mode page found
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] Write Protect is off
Feb 03 15:57:52 arch kernel: sd 0:0:0:0: [sda] 62844672 512-byte logical blocks: (32.2 GB/30.>
Feb 03 15:57:52 arch kernel: scsi 0:0:0:0: Direct-Access     hp       v220w            1100 P>
Feb 03 15:57:50 arch mtp-probe[81013]: bus: 3, device: 42 was not an MTP device
Feb 03 15:57:50 arch mtp-probe[81013]: checking bus 3, device 42: "/sys/devices/pci0000:00/00>
Feb 03 15:57:50 arch kernel: usbcore: registered new interface driver uas
Feb 03 15:57:50 arch kernel: usbcore: registered new interface driver usb-storage
Feb 03 15:57:50 arch kernel: scsi host0: usb-storage 3-1:1.0
Feb 03 15:57:50 arch kernel: usb-storage 3-1:1.0: USB Mass Storage device detected
Feb 03 15:57:50 arch mtp-probe[81005]: bus: 3, device: 42 was not an MTP device
Feb 03 15:57:50 arch mtp-probe[81005]: checking bus 3, device 42: "/sys/devices/pci0000:00/00>
Feb 03 15:57:50 arch kernel: usb 3-1: SerialNumber: AE2CHE02000000074
Feb 03 15:57:50 arch kernel: usb 3-1: Manufacturer: HP
Feb 03 15:57:50 arch kernel: usb 3-1: Product: v220w
Feb 03 15:57:50 arch kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 03 15:57:50 arch kernel: usb 3-1: New USB device found, idVendor=03f0, idProduct=5a07, bc>
Feb 03 15:57:50 arch kernel: usb 3-1: new high-speed USB device number 42 using xhci_hcd
```

i wanna add hooks to those events so that i can mount or do something else with them on detection

Offline

#2 2024-02-03 11:19:16

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: How to respond to kernel events with custom scripts (hooks)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

Board footer

Powered by FluxBB