def get_unit_file():
u = """[Unit]
Description=Ceph daemon for {fsid}
-After=network.target
+
+# According to:
+# http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
+# these can be removed once ceph-mon will dynamically change network
+# configuration.
+After=network-online.target local-fs.target time-sync.target
+Wants=network-online.target local-fs.target time-sync.target
PartOf=ceph-{fsid}.target
Before=ceph-{fsid}.target
[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
EnvironmentFile=-/etc/environment
ExecStartPre=-/usr/bin/podman rm ceph-{fsid}-%i
ExecStartPre=-mkdir -p /var/run/ceph
ExecStart={data_dir}/{fsid}/%i/cmd
ExecStop=-/usr/bin/podman stop ceph-{fsid}-%i
ExecStopPost=-/bin/rm -f /var/run/ceph/{fsid}-%i.asok
-Restart=always
+Restart=on-failure
RestartSec=10s
TimeoutStartSec=120
TimeoutStopSec=15
+StartLimitInterval=30min
+StartLimitBurst=5
[Install]
WantedBy=ceph-{fsid}.target