Skip to content

Instantly share code, notes, and snippets.

@gdoteof
Last active August 29, 2015 14:16
Show Gist options
  • Save gdoteof/18bf20f148bf18e885f4 to your computer and use it in GitHub Desktop.
Save gdoteof/18bf20f148bf18e885f4 to your computer and use it in GitHub Desktop.
core@ztest01 ~ $ fleetctl load test.service
Unit test.service loaded on 96fb30af.../10.132.114.122
core@ztest01 ~ $ fleetctl start test.service
Unit test.service launched on 96fb30af.../10.132.114.122
core@ztest01 ~ $ cat test.service
[Unit]
Description=test
# Requirements
Requires=etcd.service
# Dependency ordering and binding
After=etcd.service
[Service]
# Get CoreOS environmental variables
EnvironmentFile=/etc/environment
ExecStart=/bin/bash -c '\
while true; do \
etcdctl set /services/test/${COREOS_PRIVATE_IPV4} \'${LOL}:%i\' --ttl 30; \
sleep 5; \
done'
# Stop
ExecStop=/usr/bin/etcdctl rm /services/test/${COREOS_PRIVATE_IPV4}
[X-Fleet]
# Schedule on the same machine as the associated Apache service
core@ztest01 ~ $ vi tst\@.service
core@ztest01 ~ $ fleetctl submit tst\@.service
core@ztest01 ~ $ cat tst\@.service
[Unit]
Description=test template
# Requirements
Requires=etcd.service
# Dependency ordering and binding
After=etcd.service
[Service]
# Get CoreOS environmental variables
EnvironmentFile=/etc/environment
ExecStart=/bin/bash -c '\
while true; do \
etcdctl set /services/test2/${COREOS_PRIVATE_IPV4} \'${LOL}:%i\' --ttl 30; \
sleep 5; \
done'
# Stop
ExecStop=/usr/bin/etcdctl rm /services/test2/%i
[X-Fleet]
# Schedule on the same machine as the associated Apache service
core@ztest01 ~ $ fleetctl start [email protected]
# IT HANGS HERE INDEFINITELY
^Ccore@ztest01 ~ $ fleetctl list-units
UNIT MACHINE ACTIVE SUB
test.service 96fb30af.../10.132.114.122 active running
core@ztest01 ~ $ fleetctl list-unit-files
UNIT HASH DSTATE STATE TARGET
test.service de6664b launched launched 96fb30af.../10.132.114.122
[email protected] c9f7926 inactive inactive -
[email protected] c9f7926 launched inactive 96fb30af.../10.132.114.122
core@ztest01 ~ $ fleetctl status [email protected]
Unit [email protected] does not appear to be loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment