Writing udev rules for handling CP special messages
When using the CP special messages device driver, CP special messages trigger uevents.
- change events
- The smsgiucv_app device driver generates
change
uevents for each CP special message that is received.For example, the special message:
might trigger the following uevent:#CP SMSG LXGUEST1 APP THIS IS A TEST MESSAGE
UEVENT[1263487666.708881] change /devices/iucv/smsgiucv_app (iucv) ACTION=change DEVPATH=/devices/iucv/smsgiucv_app SUBSYSTEM=iucv SMSG_SENDER=MAINT SMSG_ID=APP SMSG_TEXT=THIS IS A TEST MESSAGE DRIVER=SMSGIUCV SEQNUM=1493
- add and remove events
- In addition to the
change
event for received CP special messages, genericadd
andremove
events are generated when the module is loaded or unloaded, for example:UEVENT[1263487583.511146] add /module/smsgiucv_app (module) ACTION=add DEVPATH=/module/smsgiucv_app SUBSYSTEM=module SEQNUM=1487 UEVENT[1263487583.514622] add /devices/iucv/smsgiucv_app (iucv) ACTION=add DEVPATH=/devices/iucv/smsgiucv_app SUBSYSTEM=iucv DRIVER=SMSGIUCV SEQNUM=1488 UEVENT[1263487628.955149] remove /devices/iucv/smsgiucv_app (iucv) ACTION=remove DEVPATH=/devices/iucv/smsgiucv_app SUBSYSTEM=iucv SEQNUM=1489 UEVENT[1263487628.957082] remove /module/smsgiucv_app (module) ACTION=remove DEVPATH=/module/smsgiucv_app SUBSYSTEM=module SEQNUM=1490
With the information from the uevents, you can create custom udev rules to trigger actions that depend on the settings of the SMSG_* environment variables.
For
your udev rules, use the add
and remove
uevents
to initialize and clean up resources. To handle CP special messages,
write udev rules that match change
uevents. For more
information about writing udev rules, see the udev man page.