Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Sep 2019 09:07:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 240411] devd behaves odd when action uses single quotes
Message-ID:  <bug-240411-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240411

            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@FreeBSD.org
          Reporter: nvass@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_na=
me
finished scrubbing'";
};

creates these messages in /var/log/messages
Sep  8 11:51:35 aurora ZFS[12797]: vdev state changed,
pool_guid=3D$5355245379867352521 vdev_guid=3D$1907996185387027531
Sep  8 11:51:35 aurora ZFS[12798]: vdev state changed,
pool_guid=3D$5355245379867352521 vdev_guid=3D$9030209902286509774
Sep  8 11:51:35 aurora ZFS[12799]: vdev state changed,
pool_guid=3D$5355245379867352521 vdev_guid=3D$2872996488705391350
Sep  8 11:51:35 aurora ZFS[12800]: vdev state changed,
pool_guid=3D$5355245379867352521 vdev_guid=3D$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.=20

/var/run/devd.pipe on FBSD-12:
!system=3DZFS subsystem=3DZFS type=3Dresource.fs.zfs.statechange  version=
=3D0
class=3Dresource.fs.zfs.statechange pool_guid=3D5355245379867352521
vdev_guid=3D1907996185387027531
!system=3DZFS subsystem=3DZFS type=3Dresource.fs.zfs.statechange  version=
=3D0
class=3Dresource.fs.zfs.statechange pool_guid=3D5355245379867352521
vdev_guid=3D9030209902286509774
!system=3DZFS subsystem=3DZFS type=3Dresource.fs.zfs.statechange  version=
=3D0
class=3Dresource.fs.zfs.statechange pool_guid=3D5355245379867352521
vdev_guid=3D2872996488705391350
!system=3DZFS subsystem=3DZFS type=3Dresource.fs.zfs.statechange  version=
=3D0
class=3Dresource.fs.zfs.statechange pool_guid=3D5355245379867352521
vdev_guid=3D13633596582270114039
!system=3DZFS subsystem=3DZFS type=3Dmisc.fs.zfs.scrub_start  pool_name=3Da=
urora-os
pool_guid=3D5355245379867352521
!system=3DZFS subsystem=3DZFS type=3Dmisc.fs.zfs.history_event  pool_name=
=3Daurora-os
pool_guid=3D5355245379867352521 history_hostname=3Daurora.local
history_internal_str=3Dfunc=3D1 mintxg=3D0 maxtxg=3D1064734 history_interna=
l_name=3Dscan
setup history_txg=3D1064734 history_time=3D1567933234



/var/run/devd.pipe on FBSD-10:
!system=3DZFS subsystem=3DZFS type=3Dmisc.fs.zfs.scrub_start  pool_name=3Dc=
lio
pool_guid=3D1203689305036940146

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240411-227>