[Bug 240411] devd behaves odd when action uses single quotes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Sep 8 09:07:02 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240411

            Bug ID: 240411
           Summary: devd behaves odd when action uses single quotes
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: nvass at gmx.com

Using this rule on FreeBSD-12:
notify 10 {
        match "system"          "ZFS";
        match "type"            "misc.fs.zfs.scrub_start";
        action "touch /var/run/scrub_$pool_name; logger -t ZFS 'zpool
$pool_name started scrubbing'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "misc.fs.zfs.scrub_finish";
        action "rm /var/run/scrub_$pool_name; logger -t ZFS 'zpool $pool_name
finished scrubbing'";
};

creates these messages in /var/log/messages
Sep  8 11:51:35 aurora ZFS[12797]: vdev state changed,
pool_guid=$5355245379867352521 vdev_guid=$1907996185387027531
Sep  8 11:51:35 aurora ZFS[12798]: vdev state changed,
pool_guid=$5355245379867352521 vdev_guid=$9030209902286509774
Sep  8 11:51:35 aurora ZFS[12799]: vdev state changed,
pool_guid=$5355245379867352521 vdev_guid=$2872996488705391350
Sep  8 11:51:35 aurora ZFS[12800]: vdev state changed,
pool_guid=$5355245379867352521 vdev_guid=$13633596582270114039
Sep  8 11:51:35 aurora ZFS[12801]: zpool $aurora-os started scrubbing

The pool name should be aurora-os without the leading dollar sign. This only
happens when variables are enclosed in single quotes. The same rule behaves
correctly on earlier versions. 

/var/run/devd.pipe on FBSD-12:
!system=ZFS subsystem=ZFS type=resource.fs.zfs.statechange  version=0
class=resource.fs.zfs.statechange pool_guid=5355245379867352521
vdev_guid=1907996185387027531
!system=ZFS subsystem=ZFS type=resource.fs.zfs.statechange  version=0
class=resource.fs.zfs.statechange pool_guid=5355245379867352521
vdev_guid=9030209902286509774
!system=ZFS subsystem=ZFS type=resource.fs.zfs.statechange  version=0
class=resource.fs.zfs.statechange pool_guid=5355245379867352521
vdev_guid=2872996488705391350
!system=ZFS subsystem=ZFS type=resource.fs.zfs.statechange  version=0
class=resource.fs.zfs.statechange pool_guid=5355245379867352521
vdev_guid=13633596582270114039
!system=ZFS subsystem=ZFS type=misc.fs.zfs.scrub_start  pool_name=aurora-os
pool_guid=5355245379867352521
!system=ZFS subsystem=ZFS type=misc.fs.zfs.history_event  pool_name=aurora-os
pool_guid=5355245379867352521 history_hostname=aurora.local
history_internal_str=func=1 mintxg=0 maxtxg=1064734 history_internal_name=scan
setup history_txg=1064734 history_time=1567933234



/var/run/devd.pipe on FBSD-10:
!system=ZFS subsystem=ZFS type=misc.fs.zfs.scrub_start  pool_name=clio
pool_guid=1203689305036940146

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list