1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
lvm2/scripts/lvm2_clvmd_red_hat.service.in
Ondrej Kozina fd41dd8f9c Add systemd native service for clvmd and cluster activation
The commit splits original clvmd service in two new native services
for systemd enabled systems while original init scripts remain unaltered.

New systemd native services:

  1) clvmd daemon itself (lvm2_clvmd_red_hat.service.in)
  2) (de)activation of clustered VGs (lvm2_cluster_activation_red_hat.service.in)

There're several reasons to split it. First, there's no support for conditional
stop in systemd and AFAIK they don't plan to support it. In other words:
if the deactivation fails for some reason, systemd doesn't care and will simply
kill all remaining processes in original cgroup (by default). Killing the
remaining procs can be suppressed however it doesn't solve the following problem:

You can't repeat the stop command of a failed service. The repeated stop command
is simply not propagated to the service in a failed state. You would have to start
and then try to stop the service again. Unfortunately, this can't be done while
the daemon is still running (and we need the daemon to stay active until all
clustered VGs are deactivated properly).

In a separated setup we need only to restart the failed activation service and
that's fine.
2014-02-10 17:13:49 +01:00

22 lines
501 B
SYSTEMD

[Unit]
Description=Clustered LVM daemon
Documentation=man:clvmd(8)
After=dlm.service corosync.service
Before=remote-fs.target
Requires=network.target dlm.service corosync.service
RefuseManualStart=true
RefuseManualStop=true
StopWhenUnneeded=true
[Service]
Type=forking
Environment=CLVMD_OPTS=-T30
EnvironmentFile=-@sysconfdir@/sysconfig/clvmd
ExecStart=@sbindir@/clvmd $CLVMD_OPTS
SuccessExitStatus=5
TimeoutStartSec=30
TimeoutStopSec=10
OOMScoreAdjust=-1000
Restart=on-abort
PIDFile=@CLVMD_PIDFILE@