This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| import "os" | |
| import "os/exec" | |
| import "os/signal" | |
| import "syscall" | |
| import "io/ioutil" | |
| func f(from string) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| gcc trap_signal.c -o trap_signal | |
| start: | |
| ./trap_signal $(pidof trap_signal) | |
| tail -f /tmp/log.txt | |
| */ | |
| #include <signal.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| [ -z ${CONSUL_IP} ] && { echo "please export CONSUL_IP" && exit 1; } | |
| CONSUL_TEMPLATE_LOG=debug | |
| CONSUL_TEMPLATE_LOG_OUTPUT="/tmp/consul_template.debug" | |
| CONSUL_TEMPLATE_OUTPUT="/tmp/haproxy.cfg" | |
| cat > template.cfg << EOF | |
| {{range services}}{{\$service:=.Name}}{{range .Tags}}{{if or (eq . "webapp") (eq . "haproxy")}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2015-02-17 19:41:14,081 CRIT Supervisor running as root (no user in config file) | |
| 2015-02-17 19:41:14,111 INFO RPC interface 'supervisor' initialized | |
| 2015-02-17 19:41:14,111 CRIT Server 'inet_http_server' running without any HTTP authentication checking | |
| 2015-02-17 19:41:14,111 INFO RPC interface 'supervisor' initialized | |
| 2015-02-17 19:41:14,111 CRIT Server 'unix_http_server' running without any HTTP authentication checking | |
| 2015-02-17 19:41:14,112 INFO supervisord started with pid 1 | |
| 2015-02-17 19:41:15,114 INFO spawned: 'stdout' with pid 11 | |
| 2015-02-17 19:41:15,119 INFO spawned: 'haproxy_configurator' with pid 12 | |
| 2015-02-17 19:41:16,163 INFO success: stdout entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) | |
| 2015-02-17 19:41:16,163 INFO success: haproxy_configurator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) |