From: Patrick Donnelly Date: Wed, 19 Oct 2016 00:20:34 +0000 (-0400) Subject: systemd: add ceph-fuse service file X-Git-Tag: v11.1.1~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d32d70b783e74ba56966c09ae0785cfb0dedf8c5;p=ceph.git systemd: add ceph-fuse service file Signed-off-by: Patrick Donnelly --- diff --git a/ceph.spec.in b/ceph.spec.in index 03021690ede..764f34af3ab 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -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,-) diff --git a/debian/rules b/debian/rules index a3d189353fa..59991c500ea 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/doc/cephfs/fuse.rst b/doc/cephfs/fuse.rst index cd6d74edf65..ac6867481d2 100644 --- a/doc/cephfs/fuse.rst +++ b/doc/cephfs/fuse.rst @@ -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 diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index 8a1667f9716..240a565d09e 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -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 index 00000000000..7e37a9dc537 --- /dev/null +++ b/systemd/ceph-fuse.target @@ -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 index 00000000000..98982441ebc --- /dev/null +++ b/systemd/ceph-fuse@.service @@ -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