]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Template systemd/ceph-osd@.service with autotools,
authorOwen Synge <osynge@suse.com>
Tue, 26 May 2015 17:02:36 +0000 (19:02 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:17 +0000 (11:24 +0100)
The libexec path is different for different distributions.
systemd. This path is defined by a new variable on the
configure path.

This variable can be set with enviroment SYSTEMD_LIBEXEC_DIR.
The parameter --with-systemd-libexec-dir overrides the enviroment
variable.

Appropriate conditionals are set for SUSE and RHEL derivatives.

This is then used to template out systemd/ceph-osd@.service

Signed-off-by: Owen Synge <osynge@suse.com>
(cherry picked from commit ac347dc3402a50fa0ba8c04cf2f93c36283eca87)

Conflicts:
configure.ac
            do not include doc/Makefile

ceph.spec.in
configure.ac
systemd/ceph-osd@.service [deleted file]
systemd/ceph-osd@.service.in [new file with mode: 0644]

index ba62fb5bf3a37f31c2b91b2542baf44bfa968fe2..0cfdad784d52bd1de7f45f2755a55cbc5f9b2fb6 100644 (file)
@@ -483,6 +483,12 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
                --enable-cephfs-java \
 %endif
                --with-librocksdb-static=check \
+%if 0%{?rhel} || 0%{?fedora}
+               --with-systemd-libexec-dir=/usr/libexec/ceph \
+%endif
+%if 0%{?opensuse} || 0%{?suse_version}
+               --with-systemd-libexec-dir=/usr/lib/ceph/ \
+%endif
                $MY_CONF_OPT \
                %{?_with_ocf} \
                CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
index 969baed8357dbca3dd25ba7577fe193eb653ec52..0d7991bafe8c09a83d577f682bf09aa88791cdd7 100644 (file)
@@ -1132,6 +1132,47 @@ if test "x$enable_valgrind" = "xyes"; then
 fi
 
 
+dnl systemd-libexec-dir
+AC_SUBST(systemd_libexec_dir)
+AC_ARG_WITH(
+    systemd-libexec-dir,
+    AS_HELP_STRING(
+           [--with-systemd-libexec-dir=DIR],
+           [systemd libexec directory @<:@SYSTEMD_LIBEXEC_DIR@:>@
+        defaults to --libexecdir=DIR]
+    ),
+    [
+           systemd_libexec_dir="$withval"
+    ],
+    [
+        if test "x$SYSTEMD_LIBEXEC_DIR" = "x"; then
+            dnl store old values
+
+            prefix_save=$prefix
+            exec_prefix_save=$exec_prefix
+
+            dnl if no prefix given, then use /usr/local, the default prefix
+            if test "x$prefix" = "xNONE"; then
+                prefix="$ac_default_prefix"
+            fi
+            dnl if no exec_prefix given, then use prefix
+            if test "x$exec_prefix" = "xNONE"; then
+                exec_prefix=$prefix
+            fi
+
+            dnl now get the expanded default
+            systemd_libexec_dir="`eval exec_prefix=$exec_prefix prefix=$prefix echo $libexecdir`"
+
+            dnl now cleanup prefix and exec_prefix
+
+            prefix=$prefix_save
+            exec_prefix=$exec_prefix_save
+        else
+            systemd_libexec_dir="$SYSTEMD_LIBEXEC_DIR"
+        fi
+    ]
+)
+
 # Checks for typedefs, structures, and compiler characteristics.
 #AC_HEADER_STDBOOL
 #AC_C_CONST
@@ -1193,5 +1234,6 @@ AC_CONFIG_FILES([Makefile
        src/java/Makefile
        src/tracing/Makefile
        man/Makefile
+       systemd/ceph-osd@.service
        ceph.spec])
 AC_OUTPUT
diff --git a/systemd/ceph-osd@.service b/systemd/ceph-osd@.service
deleted file mode 100644 (file)
index 3c77805..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Ceph object storage daemon
-After=network-online.target local-fs.target
-Wants=network-online.target local-fs.target
-PartOf=ceph.target
-
-[Service]
-EnvironmentFile=-/etc/sysconfig/ceph
-Environment=CLUSTER=ceph
-ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i
-ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
-LimitNOFILE=131072
-ExecReload=/bin/kill -HUP $MAINPID
-
-[Install]
-WantedBy=ceph.target
diff --git a/systemd/ceph-osd@.service.in b/systemd/ceph-osd@.service.in
new file mode 100644 (file)
index 0000000..72d21f4
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=Ceph object storage daemon
+After=network-online.target local-fs.target
+Wants=network-online.target local-fs.target
+PartOf=ceph.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/ceph
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i
+ExecStartPre=@systemd_libexec_dir@/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
+LimitNOFILE=131072
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=ceph.target