diff mbox series

[v4,09/10] cxl: add systemd service for monitor

Message ID 166793223975.3768752.11846694721780323639.stgit@djiang5-desk3.ch.intel.com
State New, archived
Headers show
Series cxl: add monitor support for trace events | expand

Commit Message

Dave Jiang Nov. 8, 2022, 6:30 p.m. UTC
Add a systemd service file for cxl monitor to start the monitoring service
on boot initialization. Add the installation setup for the service file.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 cxl/cxl-monitor.service |    9 +++++++++
 cxl/meson.build         |    4 ++++
 ndctl.spec.in           |    1 +
 3 files changed, 14 insertions(+)
 create mode 100644 cxl/cxl-monitor.service

Comments

Verma, Vishal L Nov. 9, 2022, 12:48 a.m. UTC | #1
On Tue, 2022-11-08 at 11:30 -0700, Dave Jiang wrote:
> Add a systemd service file for cxl monitor to start the monitoring service
> on boot initialization. Add the installation setup for the service file.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  cxl/cxl-monitor.service |    9 +++++++++
>  cxl/meson.build         |    4 ++++
>  ndctl.spec.in           |    1 +
>  3 files changed, 14 insertions(+)
>  create mode 100644 cxl/cxl-monitor.service
> 
> diff --git a/cxl/cxl-monitor.service b/cxl/cxl-monitor.service
> new file mode 100644
> index 000000000000..87c842b6f595
> --- /dev/null
> +++ b/cxl/cxl-monitor.service
> @@ -0,0 +1,9 @@
> +[Unit]
> +Description=Cxl Monitor Daemon

s/Cxl/CXL/

> +
> +[Service]
> +Type=simple
> +ExecStart=/usr/bin/cxl monitor
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/cxl/meson.build b/cxl/meson.build
> index eb8b2b1070ed..fc2e946707a8 100644
> --- a/cxl/meson.build
> +++ b/cxl/meson.build
> @@ -11,6 +11,10 @@ cxl_src = [
>    'monitor.c',
>  ]
>  
> +if get_option('systemd').enabled()
> +  install_data('cxl-monitor.service', install_dir : systemdunitdir)
> +endif
> +
>  cxl_tool = executable('cxl',
>    cxl_src,
>    include_directories : root_inc,
> diff --git a/ndctl.spec.in b/ndctl.spec.in
> index cfcafa2ba816..c883317c5ce7 100644
> --- a/ndctl.spec.in
> +++ b/ndctl.spec.in
> @@ -194,6 +194,7 @@ fi
>  %{_bindir}/cxl
>  %{_mandir}/man1/cxl*
>  %{bashcompdir}/cxl
> +%{_unitdir}/cxl-monitor.service
>  
>  %files -n LNAME
>  %defattr(-,root,root)
> 
>
diff mbox series

Patch

diff --git a/cxl/cxl-monitor.service b/cxl/cxl-monitor.service
new file mode 100644
index 000000000000..87c842b6f595
--- /dev/null
+++ b/cxl/cxl-monitor.service
@@ -0,0 +1,9 @@ 
+[Unit]
+Description=Cxl Monitor Daemon
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/cxl monitor
+
+[Install]
+WantedBy=multi-user.target
diff --git a/cxl/meson.build b/cxl/meson.build
index eb8b2b1070ed..fc2e946707a8 100644
--- a/cxl/meson.build
+++ b/cxl/meson.build
@@ -11,6 +11,10 @@  cxl_src = [
   'monitor.c',
 ]
 
+if get_option('systemd').enabled()
+  install_data('cxl-monitor.service', install_dir : systemdunitdir)
+endif
+
 cxl_tool = executable('cxl',
   cxl_src,
   include_directories : root_inc,
diff --git a/ndctl.spec.in b/ndctl.spec.in
index cfcafa2ba816..c883317c5ce7 100644
--- a/ndctl.spec.in
+++ b/ndctl.spec.in
@@ -194,6 +194,7 @@  fi
 %{_bindir}/cxl
 %{_mandir}/man1/cxl*
 %{bashcompdir}/cxl
+%{_unitdir}/cxl-monitor.service
 
 %files -n LNAME
 %defattr(-,root,root)