From: Dan Williams <dan.j.williams@intel.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
"qi.fuli@fujitsu.com" <qi.fuli@fujitsu.com>,
"Hu, Fenghua" <fenghua.hu@intel.com>,
"qi.fuli@jp.fujitsu.com" <qi.fuli@jp.fujitsu.com>
Subject: Re: [ndctl PATCH 7/7] daxctl: add systemd service and udev rule for auto-onlining
Date: Wed, 17 Nov 2021 19:40:32 -0800 [thread overview]
Message-ID: <CAPcyv4h4-txd-o0gYZU_D=2VPg63v_69QEpO=cY28H47Ju3Wqg@mail.gmail.com> (raw)
In-Reply-To: <bb9ea18f9845ec93ae72f77a42c563693ac8aaab.camel@intel.com>
On Wed, Nov 17, 2021 at 6:40 PM Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
>
> On Fri, 2021-09-17 at 11:10 -0700, Dan Williams wrote:
> > On Tue, Aug 31, 2021 at 2:05 AM Vishal Verma <vishal.l.verma@intel.com> wrote:
> > >
> > > Install a helper script that calls daxctl-reconfigure-device with the
> > > new 'check-config' option for a given device. This is meant to be called
> > > via a systemd service.
> > >
> > > Install a systemd service that calls the above wrapper script with a
> > > daxctl device passed in to it via the environment.
> > >
> > > Install a udev rule that is triggered for every daxctl device, and
> > > triggers the above oneshot systemd service.
> > >
> > > Together, these three things work such that upon boot, whenever a daxctl
> > > device is found, udev triggers a device-specific systemd service called,
> > > for example:
> > >
> > > daxdev-reconfigure@-dev-dax0.0.service
> >
> > I'm thinking the service would be called daxdev-add, because it is
> > servicing KOBJ_ADD events, or is the convention to name the service
> > after what it does vs what it services?
>
> I don't know of a convention - but 'what it does' seemed more natural
> for a service than 'when it's called'. It also correlates better with
> usual system service names (i.e. they are named after what they do).
>
> >
> > Also, I'm curious why would "dax0.0" be in the service name, shouldn't
> > this be scanning all dax devices and internally matching based on the
> > config file?
>
> Systemd black magic? the dax0.0 doesn't come from anything I configure
> - that's just how systemd's 'instantiated services' work. Each newly
> added device gets it's own service tied to a unique identifier for the
> device. For these, it happens to be /dev/dax0.0, which gets escaped to
> -dev-dax0.0.
>
> More reading here:
> http://0pointer.de/blog/projects/instances.html
>
> >
> > >
> > > This initiates a daxctl-reconfigure-device with a config lookup for the
> > > 'dax0.0' device. If the config has an '[auto-online <unique_id>]'
> > > section, it uses the information in that to set the operating mode of
> > > the device.
> > >
> > > If any device is in an unexpected status, 'journalctl' can be used to
> > > view the reconfiguration log for that device, for example:
> > >
> > > journalctl --unit daxdev-reconfigure@-dev-dax0.0.service
> >
> > There will be a log per-device, or only if there is a service per
> > device? My assumption was that this service is firing off for all
> > devices so you would need to filter the log by the device-name if you
> > know it... or maybe I'm misunderstanding how this udev service works.
>
> There will be both a log and a service per device - the unit file we
> supply/install is essentially a template for these instantiated
> services, but the actual service kicked off is <foo>@<device-
> id>.service
Ah, ok, that makes sense.
next prev parent reply other threads:[~2021-11-18 3:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 9:04 [ndctl PATCH 0/7] Policy based reconfiguration for daxctl Vishal Verma
2021-08-31 9:04 ` [ndctl PATCH 1/7] ndctl: Update ndctl.spec.in for 'ndctl.conf' Vishal Verma
2021-09-02 12:15 ` qi.fuli
2021-08-31 9:04 ` [ndctl PATCH 2/7] daxctl: Documentation updates for persistent reconfiguration Vishal Verma
2021-09-16 22:47 ` Dan Williams
2021-11-17 23:02 ` Verma, Vishal L
2021-08-31 9:04 ` [ndctl PATCH 3/7] util/parse-config: refactor filter_conf_files into util/ Vishal Verma
2021-09-02 12:17 ` qi.fuli
2021-09-16 22:54 ` Dan Williams
2021-08-31 9:04 ` [ndctl PATCH 4/7] daxctl: add basic config parsing support Vishal Verma
2021-09-02 12:19 ` qi.fuli
2021-09-16 22:58 ` Dan Williams
2021-11-17 23:17 ` Verma, Vishal L
2021-08-31 9:04 ` [ndctl PATCH 5/7] util/parse-configs: add a key/value search helper Vishal Verma
2021-09-02 13:12 ` qi.fuli
2021-09-16 23:54 ` Dan Williams
2021-11-17 23:21 ` Verma, Vishal L
2021-08-31 9:04 ` [ndctl PATCH 6/7] daxctl/device.c: add an option for getting params from a config file Vishal Verma
2021-09-17 1:59 ` Dan Williams
2021-11-17 23:45 ` Verma, Vishal L
2021-08-31 9:04 ` [ndctl PATCH 7/7] daxctl: add systemd service and udev rule for auto-onlining Vishal Verma
2021-09-03 0:56 ` qi.fuli
2021-09-17 18:10 ` Dan Williams
2021-11-17 23:29 ` Verma, Vishal L
2021-11-17 23:43 ` Dan Williams
2021-11-18 2:40 ` Verma, Vishal L
2021-11-18 3:40 ` Dan Williams [this message]
2021-09-16 22:12 ` [ndctl PATCH 0/7] Policy based reconfiguration for daxctl Dan Williams
2021-11-19 20:57 ` Verma, Vishal L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPcyv4h4-txd-o0gYZU_D=2VPg63v_69QEpO=cY28H47Ju3Wqg@mail.gmail.com' \
--to=dan.j.williams@intel.com \
--cc=fenghua.hu@intel.com \
--cc=nvdimm@lists.linux.dev \
--cc=qi.fuli@fujitsu.com \
--cc=qi.fuli@jp.fujitsu.com \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).