Skip to content

Instantly share code, notes, and snippets.

@andyshinn
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save andyshinn/63a2518e88178bfe8891 to your computer and use it in GitHub Desktop.

Select an option

Save andyshinn/63a2518e88178bfe8891 to your computer and use it in GitHub Desktop.

The announcement sidekick unit:

$ fleetctl cat [email protected]
[Unit]
Description=Firehose etcd announcer
BindsTo=firehose@%i.service

[Service]
TimeoutStartSec=30s
ExecStart=/bin/sh -c "echo -n 'Setting etcd key /firehose/instance/firehose-%i to: '; etcdctl set /firehose/instance/firehose-%i $(docker inspect -f '{{.NetworkSettings.IPAddress}}' firehose-%i)"
ExecStop=/bin/sh -c "echo -n \"Removing etcd key /firehose/instance/firehose-%i\"; etcdctl rm --recursive /firehose/instance/firehose-%i

[X-Fleet]
X-ConditionMachineOf=firehose@%i.service

The unit it binds to is already running and working:

$ fleetctl status [email protected]
[email protected] - Firehose Rainbows! Server
   Loaded: loaded (/run/fleet/units/[email protected]; linked-runtime)
   Active: active (running) since Wed 2014-06-11 04:08:18 UTC; 15h ago

But the sidekick unit won't start... or even timeout...

$ time fleetctl start [email protected]
^C
real	0m59.412s
user	0m0.425s
sys	0m0.134s

Nothing in journal since it never starts:

$ fleetctl journal [email protected]
Job [email protected] does not appear to be running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment