]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
systemd: add ceph-fuse service file 11542/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 19 Oct 2016 00:20:34 +0000 (20:20 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 2 Dec 2016 00:51:37 +0000 (19:51 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
ceph.spec.in
debian/rules
doc/cephfs/fuse.rst
systemd/CMakeLists.txt
systemd/ceph-fuse.target [new file with mode: 0644]
systemd/ceph-fuse@.service [new file with mode: 0644]

index 03021690eded2bd7c29a7bdd894138919096d848..764f34af3ab7be3193d9b11da8b1352e0de0e3b2 100644 (file)
@@ -1156,6 +1156,8 @@ fi
 %{_bindir}/ceph-fuse
 %{_mandir}/man8/ceph-fuse.8*
 %{_sbindir}/mount.fuse.ceph
+%{_unitdir}/ceph-fuse@.service
+%{_unitdir}/ceph-fuse.target
 
 %files -n rbd-fuse
 %defattr(-,root,root,-)
index a3d189353fa740a31e0031e756eb15f0317345d8..59991c500ea0314797a75f0923caff813475ae0a 100755 (executable)
@@ -96,6 +96,11 @@ override_dh_installinit:
        sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mds/lib/systemd/system/ceph-mds@.service
        install -m0644 systemd/ceph-mds.target debian/ceph-mds/lib/systemd/system
 
+       install -d -m0755 debian/ceph-fuse/lib/systemd/system
+       install -m0644 systemd/ceph-fuse@.service debian/ceph-fuse/lib/systemd/system
+       sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-fuse/lib/systemd/system/ceph-fuse@.service
+       install -m0644 systemd/ceph-fuse.target debian/ceph-fuse/lib/systemd/system
+
        install -d -m0755 debian/ceph-mgr/lib/systemd/system
        install -m0644 systemd/ceph-mgr@.service debian/ceph-mgr/lib/systemd/system
        sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mgr/lib/systemd/system/ceph-mgr@.service
@@ -119,6 +124,7 @@ override_dh_systemd_start:
 
 override_dh_strip:
        dh_strip -pceph-mds --dbg-package=ceph-mds-dbg
+       dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg
        dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg
        dh_strip -pceph-mon --dbg-package=ceph-mon-dbg
        dh_strip -pceph-osd --dbg-package=ceph-osd-dbg
index cd6d74edf65b7d0f5ad5269ed0cc8bb1557ea2d5..ac6867481d23d615451d3d64f97cf437f8d6e258 100644 (file)
@@ -32,5 +32,18 @@ For example::
 
 See `ceph-fuse`_ for additional details.
 
+To automate mounting ceph-fuse, you may add an entry to the system fstab_.
+Additionally, ``ceph-fuse@.service`` and ``ceph-fuse.target`` systemd units are
+available. As usual, these unit files declare the default dependencies and
+recommended execution context for ``ceph-fuse``. An example ceph-fuse mount on
+``/mnt`` would be::
+
+       sudo systemctl start ceph-fuse@/mnt.service
+
+A persistent mount point can be setup via::
+
+       sudo systemctl enable ceph-fuse@/mnt.service
+
 .. _ceph-fuse: ../../man/8/ceph-fuse/
-.. _CEPHX Config Reference: ../../rados/configuration/auth-config-ref
\ No newline at end of file
+.. _fstab: ./fstab
+.. _CEPHX Config Reference: ../../rados/configuration/auth-config-ref
index 8a1667f971635b11d3054ba004d24ec4dc5f00ac..240a565d09ecc7f76459873ef595f0cd35eb5d6c 100644 (file)
@@ -1,11 +1,13 @@
 install(FILES
   ceph.target
+  ceph-fuse.target
   ceph-osd.target
   ceph-mgr.target
   ceph-mon.target
   ceph-mds.target
   ceph-radosgw.target
   ceph-rbd-mirror.target
+  ceph-fuse@.service
   ceph-mds@.service
   ceph-mgr@.service
   ceph-mon@.service
diff --git a/systemd/ceph-fuse.target b/systemd/ceph-fuse.target
new file mode 100644 (file)
index 0000000..7e37a9d
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-fuse@.service instances at once
+PartOf=ceph.target
+[Install]
+WantedBy=remote-fs.target ceph.target
diff --git a/systemd/ceph-fuse@.service b/systemd/ceph-fuse@.service
new file mode 100644 (file)
index 0000000..9898244
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Ceph FUSE client
+After=network-online.target local-fs.target time-sync.target
+Wants=network-online.target local-fs.target time-sync.target
+Conflicts=umount.target
+PartOf=ceph-fuse.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/ceph
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-fuse -f --cluster ${CLUSTER} %I
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=3
+
+[Install]
+WantedBy=ceph-fuse.target