add cloud-config.target and make etcd hang off of that

This commit is contained in:
Alex Polvi 2014-03-18 10:52:01 -07:00
parent de0def339f
commit 1f3d02db36
5 changed files with 15 additions and 6 deletions

View File

@ -36,5 +36,7 @@ src_compile() {
src_install() {
dobin ${S}/bin/coreos-cloudinit
systemd_dounit "${FILESDIR}"/coreos-cloudinit-oem.service
systemd_dounit "${FILESDIR}"/cloud-config.target
systemd_enable_service default.target coreos-cloudinit-oem.service
systemd_enable_service default.target cloud-config.target
}

View File

@ -0,0 +1,6 @@
[Unit]
Requires=coreos-cloudinit-oem.service
After=coreos-cloudinit-oem.service
[Install]
WantedBy=multi-user.target

View File

@ -7,17 +7,12 @@ After=coreos-setup-environment.service
RequiresMountsFor=/usr/share/oem
ConditionPathExists=/usr/share/oem/cloud-config.yml
# We use this to start etcd, since cloudinit will reconfigure etcd
#Wants=etcd.service
#After=etcd.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
# XXX: We could not figure out a better way. The above Wants/After does not do this.
ExecStartPre=/usr/bin/coreos-cloudinit --from-file=/usr/share/oem/cloud-config.yml
ExecStart=/usr/bin/systemctl daemon-reload
ExecStartPost=/usr/bin/systemctl start etcd
[Install]
WantedBy=multi-user.target
WantedBy=cloudinit.target

View File

@ -37,4 +37,5 @@ src_install() {
systemd_dounit "${FILESDIR}"/${PN}.service
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
systemd_enable_service multi-user.target ${PN}.service
}

View File

@ -1,8 +1,13 @@
[Unit]
Description=etcd
After=cloud-config.target
Wants=cloud-config.target
[Service]
User=etcd
PermissionsStartOnly=true
Environment=ETCD_DATA_DIR=/var/lib/etcd ETCD_NAME=default
ExecStart=/usr/bin/etcd
[Install]
WantedBy=multi-user.target