mount ceph-fuse via systemd

jochen.korge

Member
Apr 13, 2021
11
1
8
37
Hi,
I want to mount a Ceph-FS via Systemd.
with the default service template it didn´t start so I made an Override
Bash:
  GNU nano 5.4                                           /etc/systemd/system/ceph-fuse@-mnt-ceph.service.d/.#override.conf4df7857ee6ef3e15                                                    
### Editing /etc/systemd/system/ceph-fuse@-mnt-ceph.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStart=
ExecStart=/usr/bin/ceph-fuse -f -n client.samba.gw %I

### Lines below this comment will be discarded

### /lib/systemd/system/ceph-fuse@.service
# [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]
# Environment=CLUSTER=ceph
# EnvironmentFile=-/etc/default/ceph
# ExecStart=/usr/bin/ceph-fuse -f --cluster ${CLUSTER} %I
# LockPersonality=true
# MemoryDenyWriteExecute=true
# NoNewPrivileges=true
# # ceph-fuse requires access to /dev fuse device
# PrivateDevices=no
# ProtectControlGroups=true
# ProtectHostname=true
# ProtectKernelLogs=true
# ProtectKernelModules=true
# ProtectKernelTunables=true
# Restart=on-failure
# RestrictSUIDSGID=true
# StartLimitBurst=3
# StartLimitInterval=30min
# TasksMax=infinity
# 
# [Install]
# WantedBy=ceph-fuse.target


Bash:
root@srvpbs02:/etc/systemd/system# systemctl status ceph-fuse@-mnt-ceph
● ceph-fuse@-mnt-ceph.service - Ceph FUSE client
     Loaded: loaded (/lib/systemd/system/ceph-fuse@.service; disabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/ceph-fuse@-mnt-ceph.service.d
             └─override.conf
     Active: active (running) since Wed 2023-06-07 14:26:56 CEST; 51min ago
   Main PID: 623134 (ceph-fuse)
      Tasks: 25
     Memory: 9.6M
        CPU: 970ms
     CGroup: /system.slice/system-ceph\x2dfuse.slice/ceph-fuse@-mnt-ceph.service
             └─623134 /usr/bin/ceph-fuse -f -n client.samba.gw /mnt/ceph

Jun 07 14:26:56 srvpbs02 systemd[1]: Started Ceph FUSE client.
Jun 07 14:26:56 srvpbs02 ceph-fuse[623134]: ceph-fuse[623134]: starting ceph client
Jun 07 14:26:56 srvpbs02 ceph-fuse[623134]: 2023-06-07T14:26:56.455+0200 7fe1cbd82200 -1 init, newargv = 0x559b1acfdc40 newargc=15
Jun 07 14:26:56 srvpbs02 ceph-fuse[623134]: ceph-fuse[623134]: starting fuse

It seems to Work but: The Mountpoint and mount | grep ceph are empty.
When I run /usr/bin/ceph-fuse -f -n client.samba.gw /mnt/ceph the output is identical to the journal-messages but it works. I can see the Files at /mnt/ceph and
Bash:
root@srvpbs02:~# mount | grep ceph
ceph-fuse on /mnt/ceph type fuse.ceph-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

Any Idea what I´m doing wrong here?
 
Why? Out of curiosity ;)
Systemd is here to stay, so I want to get used to it and play around with the new features.

It is on a Notebook, so there isn´t guaranteed network connectivity at boot.

But if I recall correctly, Systemd parses fstab to create Units. So maybe I´m able to let it auto create and just modify it to tailor my needs