All of lore.kernel.org
 help / color / mirror / Atom feed
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH rfc] nvme-cli: NVMf auto discovery systemd service
Date: Mon, 25 Sep 2017 16:22:53 +0300	[thread overview]
Message-ID: <ec56b6fa-89b0-6646-6618-1e857b234349@grimberg.me> (raw)
In-Reply-To: <20170925075517.3kpbkj3snig35hb2@linux-x5ow.site>


>> +        if [ ! -f /etc/nvme/discovery.conf ]; then
>> +		touch /etc/nvme/discovery.conf
>> +        fi
> 
> I don't think having an empty discovery.conf is a particularly good idea, the
> contents should be either added by hand or by some configuration/installer
> tool (YAST, Anaconda, Chef, Puppet, yada yada).

Its just placing the file there to not fail the service by definition of
the conf not being there - if its empty it just silently exits. We can
skip it if you think its not a good idea.

>> +# NVMf auto-discovery service
>> +install -m 0755 systemd/nvmf-discovery.service /lib/systemd/system/
>> +systemctl enable nvmf-discovery.service
> 
> Unconditionally starting services will is (at least for SUSE RPMs) a no-go.

OK, we can lose it.

>> +
>> +# we rely on /dev/nvme-fabrics misc device, so auto load nvme-fabrics
>> +# at boot time
>> +echo nvme-fabrics >> /etc/modules-load.d/modules.conf
> 
> This should be done in the systemd unit file I think. Something like this:
> 
>> diff --git a/systemd/nvmf-discovery.service b/systemd/nvmf-discovery.service
>> new file mode 100644
>> index 000000000000..25f7bf1f077b
>> --- /dev/null
>> +++ b/systemd/nvmf-discovery.service
>> @@ -0,0 +1,12 @@
>> +[Unit]
>> +Description=NVMf auto discovery service
>> +After=systemd-modules-load.service network-online.target
>> +
>> +[Service]
>> +Type=oneshot
> 
> ExecStartPre=-/sbin/modprobe nvme-fabrics

looks better!

      reply	other threads:[~2017-09-25 13:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24 13:01 [PATCH rfc] nvme-cli: NVMf auto discovery systemd service Sagi Grimberg
2017-09-24 14:56 ` Christoph Hellwig
2017-09-24 15:20   ` Sagi Grimberg
2017-09-25  7:55 ` Johannes Thumshirn
2017-09-25 13:22   ` Sagi Grimberg [this message]

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=ec56b6fa-89b0-6646-6618-1e857b234349@grimberg.me \
    --to=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.