nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Qi, Fuli" <qi.fuli@jp.fujitsu.com>
To: "'Verma, Vishal L'" <vishal.l.verma@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: RE: [ndctl PATCH v11 3/5] ndctl, monitor: add the unit file of systemd for ndctl-monitor service
Date: Fri, 13 Jul 2018 12:57:01 +0000	[thread overview]
Message-ID: <0DEDF3B159719A448A49EF0E7B11E3223DA7FE29@g01jpexmbkw24> (raw)
In-Reply-To: <1531450017.7574.107.camel@intel.com>

> -----Original Message-----
> From: Verma, Vishal L [mailto:vishal.l.verma@intel.com]
> Sent: Friday, July 13, 2018 11:47 AM
> To: linux-nvdimm@lists.01.org; Qi, Fuli/斉 福利 <qi.fuli@jp.fujitsu.com>
> Subject: Re: [ndctl PATCH v11 3/5] ndctl, monitor: add the unit file of systemd for
> ndctl-monitor service
> 
> 
> On Wed, 2018-07-11 at 12:00 +0900, QI Fuli wrote:
> > This patch adds the systemd unit file for ndctl-monitor service.
> > The systemd unit directory can be configured by setting environment
> > variable "--with-systemd-unit-dir[=DIR]".
> >
> > A monitor daemon can be started as a system service:
> >    # systemctl start ndctl-monitor.service
> >
> > Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>
> > ---
> >  autogen.sh                  |  3 ++-
> >  configure.ac                | 22 ++++++++++++++++++++++
> >  ndctl/Makefile.am           |  4 ++++
> >  ndctl/ndctl-monitor.service |  7 +++++++
> >  4 files changed, 35 insertions(+), 1 deletion(-)  create mode 100644
> > ndctl/ndctl-monitor.service
> 
> We install the service unit file when doing a 'make install', but I think this also
> needs an update to the RPM spec file so that RPM knows about this too.
> 

Yes, I think both the configuration file and the service unit file are need to update the
RPM spec file. I knew that hard code the path of the files is not right, and I tried to
add %{_monitor_configdir}/monitor.conf and %{_systemd_unitdir}/ndctl-monitor.service in ndctl.spec.in,
but I got failed. Would you please tell me how to update the RPM spec file?

Thank you very much.
QI

> >
> > diff --git a/autogen.sh b/autogen.sh
> > index 2a52688..21b0e25 100755
> > --- a/autogen.sh
> > +++ b/autogen.sh
> > @@ -17,7 +17,8 @@ libdir() {
> >
> >  args="--prefix=/usr \
> >  --sysconfdir=/etc \
> > ---libdir=$(libdir /usr/lib)"
> > +--libdir=$(libdir /usr/lib) \
> > +--with-systemd-unit-dir"
> >
> >  echo
> >  echo "------------------------------------------------------------
> > ----"
> > diff --git a/configure.ac b/configure.ac index cf44260..a5ba9a1 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -143,6 +143,27 @@ AC_CHECK_FUNCS([ \
> >  	secure_getenv\
> >  ])
> >
> > +PKG_PROG_PKG_CONFIG
> > +AC_ARG_WITH([systemd-unit-dir],
> > +	AS_HELP_STRING([--with-systemd-unit-dir[=DIR]],
> > +		[Directory for systemd service files]),
> > +	[],
> > +	[with_systemd_unit_dir=yes])
> > +
> > +if test "x$with_systemd_unit_dir" = "xyes"; then
> > +	def_systemd_unit_dir=$($PKG_CONFIG --
> > variable=systemdsystemunitdir systemd)
> > +	if test "x$def_systemd_unit_dir" = "x"; then
> > +		AC_MSG_ERROR([systemd support requested but pkg-
> > config unable to query systemd package])
> > +		with_systemd_unit_dir=no
> > +	else
> > +		with_systemd_unit_dir="$def_systemd_unit_dir"
> > +	fi
> > +fi
> > +
> > +AS_IF([test "x$with_systemd_unit_dir" != "xno"],
> > +	[AC_SUBST([systemd_unitdir], [$with_systemd_unit_dir])])
> > +AM_CONDITIONAL([ENABLE_SYSTEMD_UNIT_DIR], [test
> > "x$with_systemd_unit_dir" != "xno"])
> > +
> >  my_CFLAGS="\
> >  -Wall \
> >  -Wchar-subscripts \
> > @@ -184,6 +205,7 @@ AC_MSG_RESULT([
> >          sysconfdir:             ${sysconfdir}
> >          libdir:                 ${libdir}
> >          includedir:             ${includedir}
> > +	systemd-unit-dir:	${systemd_unitdir}
> >
> >          compiler:               ${CC}
> >          cflags:                 ${CFLAGS}
> > diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am index
> > ae3d894..9d008d5 100644
> > --- a/ndctl/Makefile.am
> > +++ b/ndctl/Makefile.am
> > @@ -47,3 +47,7 @@ monitor_config_file = monitor.conf
> > monitor_configdir = /etc/ndctl/  monitor_config_DATA =
> > $(monitor_config_file)  EXTRA_DIST += $(monitor_config_file)
> > +
> > +if ENABLE_SYSTEMD_UNIT_DIR
> > +systemd_unit_DATA = ndctl-monitor.service endif
> > diff --git a/ndctl/ndctl-monitor.service b/ndctl/ndctl-
> > monitor.service new file mode 100644 index 0000000..44f9326
> > --- /dev/null
> > +++ b/ndctl/ndctl-monitor.service
> > @@ -0,0 +1,7 @@
> > +[Unit]
> > +Description=Ndctl Monitor Daemon
> > +
> > +[Service]
> > +Type=forking
> > +ExecStart=/usr/bin/ndctl monitor --daemon ExecStop=/bin/kill
> > +${MAINPID}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2018-07-13 12:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11  3:00 [ndctl PATCH v11 0/5] ndctl, monitor: add ndctl monitor daemon QI Fuli
2018-07-11  3:00 ` [ndctl PATCH v11 1/5] ndctl, monitor: add a new command - monitor QI Fuli
2018-07-13  2:46   ` Verma, Vishal L
2018-07-11  3:00 ` [ndctl PATCH v11 2/5] ndctl, monitor: add main ndctl monitor configuration file QI Fuli
2018-07-11  3:00 ` [ndctl PATCH v11 3/5] ndctl, monitor: add the unit file of systemd for ndctl-monitor service QI Fuli
2018-07-13  2:46   ` Verma, Vishal L
2018-07-13 12:57     ` Qi, Fuli [this message]
2018-07-13 14:51       ` Masayoshi Mizuma
2018-07-11  3:00 ` [ndctl PATCH v11 4/5] ndctl, documentation: add manpage for monitor QI Fuli
2018-07-13  2:47   ` Verma, Vishal L
2018-07-11  3:00 ` [ndctl PATCH v11 5/5] ndctl, test: add a new unit test " QI Fuli
2018-07-12 19:51   ` Masayoshi Mizuma
2018-07-12 20:01     ` Verma, Vishal L
2018-07-13  1:44       ` Qi, Fuli
2018-07-13  2:46 ` [ndctl PATCH v11 0/5] ndctl, monitor: add ndctl monitor daemon 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=0DEDF3B159719A448A49EF0E7B11E3223DA7FE29@g01jpexmbkw24 \
    --to=qi.fuli@jp.fujitsu.com \
    --cc=linux-nvdimm@lists.01.org \
    --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).