Commit 696adabd authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Jose A. Lopes

Add systemd unit files

We add templates for systemd service files and systemd targets under
doc/examples/systemd and flag them to be built. The generated files are
also added to .gitignore.
Signed-off-by: default avatarApollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
parent 882e7d72
......@@ -83,6 +83,7 @@
/doc/examples/ganeti-node-role.ocf
/doc/examples/gnt-config-backup
/doc/examples/hooks/ipsec
/doc/examples/systemd/ganeti-*.service
# lib
/lib/_constants.py
......
......@@ -173,6 +173,7 @@ DIRS = \
doc/examples \
doc/examples/gnt-debug \
doc/examples/hooks \
doc/examples/systemd \
doc/users \
test/data/htools \
test/data/htools/rapi \
......@@ -342,7 +343,17 @@ BUILT_EXAMPLES = \
doc/examples/ganeti-master-role.ocf \
doc/examples/ganeti-node-role.ocf \
doc/examples/gnt-config-backup \
doc/examples/hooks/ipsec
doc/examples/hooks/ipsec \
doc/examples/systemd/ganeti-common.service \
doc/examples/systemd/ganeti-confd.service \
doc/examples/systemd/ganeti-kvmd.service \
doc/examples/systemd/ganeti-luxid.service \
doc/examples/systemd/ganeti-masterd.service \
doc/examples/systemd/ganeti-metad.service \
doc/examples/systemd/ganeti-mond.service \
doc/examples/systemd/ganeti-noded.service \
doc/examples/systemd/ganeti-rapi.service \
doc/examples/systemd/ganeti-wconfd.service
dist_ifup_SCRIPTS = \
tools/kvm-ifup-os \
......
[Unit]
Description = Ganeti one-off setup
[Service]
Type = oneshot
ExecStart = @PKGLIBDIR@/ensure-dirs
[Unit]
Description = Ganeti configuration daemon (confd)
Documentation = man:ganeti-confd(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-node.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/config.data
[Service]
Type = simple
User = @GNTCONFDUSER@
Group = @GNTCONFDGROUP@
ExecStart = @SBINDIR@/ganeti-confd -f
Restart = on-failure
[Install]
WantedBy = ganeti-node.target ganeti.target
[Unit]
Description = Ganeti KVM daemon (kvmd)
Documentation = man:ganeti-kvmd(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-noded.target
[Service]
Type = simple
Group = @GNTDAEMONSGROUP@
ExecStart = @SBINDIR@/ganeti-kvmd -f
Restart = on-failure
# ganeti-kvmd is started on-demand by noded, so there must be no Install
# section.
[Unit]
Description = Ganeti query daemon (luxid)
Documentation = man:ganeti-luxid(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-master.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/config.data
[Service]
Type = simple
User = @GNTLUXIDUSER@
Group = @GNTLUXIDGROUP@
ExecStart = @SBINDIR@/ganeti-luxid -f
Restart = on-failure
SuccessExitStatus = 0 11
[Install]
WantedBy = ganeti-master.target ganeti.target
[Unit]
Description = Ganeti master functionality
Documentation = man:ganeti(7)
After = syslog.target
PartOf = ganeti.target
[Install]
WantedBy = ganeti.target
[Unit]
Description = Ganeti master daemon (masterd)
Documentation = man:ganeti-masterd(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-master.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/config.data
[Service]
Type = simple
User = @GNTMASTERUSER@
Group = @GNTMASTERDGROUP@
ExecStart = @SBINDIR@/ganeti-masterd -f
Restart = on-failure
SuccessExitStatus = 0 11
[Install]
WantedBy = ganeti-master.target ganeti.target
[Unit]
Description = Ganeti instance metadata daemon (metad)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-noded.target
[Service]
Type = simple
Group = @GNTDAEMONSGROUP@
ExecStart = @SBINDIR@/ganeti-metad -f
Restart = on-failure
# ganeti-metad is started on-demand by noded, so there must be no Install
# section.
[Unit]
Description = Ganeti monitoring daemon (mond)
Documentation = man:ganeti-mond(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-node.target
[Service]
Type = simple
User = @GNTMONDUSER@
Group = @GNTMONDGROUP@
ExecStart = @SBINDIR@/ganeti-mond -f
Restart = on-failure
[Install]
WantedBy = ganeti-node.target ganeti.target
[Unit]
Description = Ganeti node functionality
Documentation = man:ganeti(7)
After = syslog.service
PartOf = ganeti.target
[Install]
WantedBy = ganeti.target
[Unit]
Description = Ganeti node daemon (noded)
Documentation = man:ganeti-noded(8)
After = ganeti-common.service
Requires = ganeti-common.service
PartOf = ganeti-node.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/server.pem
[Service]
Type = simple
User = @GNTNODEDUSER@
Group = @GNTNODEDGROUP@
ExecStart = @SBINDIR@/ganeti-noded -f
Restart = on-failure
# Important: do not kill any KVM processes
KillMode = process
[Install]
WantedBy = ganeti-node.target ganeti.target
[Unit]
Description = Ganeti RAPI daemon (rapi)
Documentation = man:ganeti-rapi(8)
Requires = ganeti-common.service
Requisite = ganeti-masterd.service
After = ganeti-common.service
PartOf = ganeti-master.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/rapi.pem
[Service]
Type = simple
User = @GNTRAPIUSER@
Group = @GNTRAPIGROUP@
ExecStart = @SBINDIR@/ganeti-rapi -f
SuccessExitStatus = 0 11
Restart = on-failure
[Install]
WantedBy = ganeti-master.target ganeti.target
[Unit]
Description = Ganeti config writer daemon (wconfd)
Documentation = man:ganeti-wconfd(8)
Requires = ganeti-common.service
After = ganeti-common.service
PartOf = ganeti-master.target
ConditionPathExists = @LOCALSTATEDIR@/lib/ganeti/config.data
[Service]
Type = simple
User = @GNTWCONFDUSER@
Group = @GNTWCONFDGROUP@
ExecStart = @SBINDIR@/ganeti-wconfd -f
Restart = on-failure
SuccessExitStatus = 0 11
[Install]
WantedBy = ganeti-master.target ganeti.target
# This is a dummy service, provided only for compatibility with SysV.
# Systemd will automatically create a SysV service called
# ganeti.service, attempting to start the initscript. Since there is no
# way to tell systemd that the initscript acts as ganeti.target (and not
# ganeti.service), we create a stub service requiring ganeti.target.
#
# This service is for compatibility only and so will not be marked for
# installation.
[Unit]
Description = Dummy Ganeti SysV compatibility service
Documentation = man:ganeti(7)
After = ganeti.target
Requires = ganeti.target
[Service]
Type = oneshot
ExecStart = /bin/true
[Unit]
Description = Ganeti virtualization cluster manager
Documentation = man:ganeti(7)
PartOf = ganeti.service
[Install]
WantedBy = multi-user.target
Also = ganeti-node.target ganeti-master.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment