summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--gluster-block.spec.in4
-rw-r--r--systemd/Makefile.am10
-rw-r--r--systemd/gluster-blockd.service.in4
-rw-r--r--systemd/gluster-blockd.sysconfig14
5 files changed, 32 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 542b5b6..77152b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,8 @@ AC_ARG_WITH(systemddir,
AC_SUBST(systemddir)
AM_CONDITIONAL([USE_SYSTEMD], test [ -d '/usr/lib/systemd/system' ])
+AC_SUBST(sysconfigdir, '/etc/sysconfig')
+
AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([gluster-block.spec
diff --git a/gluster-block.spec.in b/gluster-block.spec.in
index b784be0..0a85a01 100644
--- a/gluster-block.spec.in
+++ b/gluster-block.spec.in
@@ -53,9 +53,13 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/gluster-block*.8*
%if ( 0%{?_with_systemd:1} )
%{_unitdir}/gluster-blockd.service
+%config(noreplace) %{_sysconfdir}/sysconfig/gluster-blockd
%endif
%changelog
+* Tue Jun 06 2017 Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
+- add gluster-blockd sysconfig template
+
* Mon Mar 27 2017 Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
- add json-c-devel to build dependency list
diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index 605e1f8..2cdda4c 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -2,9 +2,17 @@ DISTCLEANFILES = Makefile.in gluster-blockd.service
CLEANFILES = *~ gluster-blockd.service
-EXTRA_DIST = gluster-blockd.service.in
+EXTRA_DIST = gluster-blockd.service.in gluster-blockd.sysconfig
if USE_SYSTEMD
# systemddir is already defined through configure.ac
systemd_DATA = gluster-blockd.service
endif
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)${sysconfigdir}; \
+ $(INSTALL_DATA) gluster-blockd.sysconfig \
+ $(DESTDIR)${sysconfigdir}/gluster-blockd;
+
+uninstall-local:
+ rm -f $(DESTDIR)${sysconfigdir}/gluster-blockd
diff --git a/systemd/gluster-blockd.service.in b/systemd/gluster-blockd.service.in
index 8970154..7a9b759 100644
--- a/systemd/gluster-blockd.service.in
+++ b/systemd/gluster-blockd.service.in
@@ -5,7 +5,9 @@ After=rpcbind.service iscsid.service target.service tcmu-runner.service
[Service]
Type=simple
-ExecStart=@prefix@/sbin/gluster-blockd
+Environment="GB_GLFS_LRU_COUNT=5"
+EnvironmentFile=-@sysconfigdir@/gluster-blockd
+ExecStart=@prefix@/sbin/gluster-blockd --glfs-lru-count $GB_GLFS_LRU_COUNT $GB_EXTRA_ARGS
KillMode=process
[Install]
diff --git a/systemd/gluster-blockd.sysconfig b/systemd/gluster-blockd.sysconfig
new file mode 100644
index 0000000..cb778d2
--- /dev/null
+++ b/systemd/gluster-blockd.sysconfig
@@ -0,0 +1,14 @@
+# These options are used by the systemd gluster-blockd.service
+# Any changes done here will reflect in the way systemd exec gluster-blockd
+# with command arguments. See "gluster-blockd --help" output for defaults
+# and possible values.
+
+
+# The default cache capacity is 5 i.e there can be a max of five glfs
+# entries in the lru cache, anything more will lead to release/free of
+# least recently used object.
+#GB_GLFS_LRU_COUNT=5
+
+
+# Expert use only, just incase if we have any extra args to pass for daemon
+#GB_EXTRA_ARGS=""