Comments (8)
I think this is because there is no newline on the end of the payload and the bash read
built-in splits on newlines by default.
from serf.
Looks like you're correct:
[vagrant@source vagrant]$ serf event foo "bar
> baz"
2013/11/01 05:06:28 [INFO] agent: Received event: user-event: foo
2013/11/01 05:06:28 [DEBUG] Event 'user' script output:
/vagrant/event.sh triggered!
SERF_EVENT is user
SERF_SELF_NAME is target.serf.dev
SERF_SELF_ROLE is target
SERF_USER_EVENT is foo
BEGIN event data
bar
END event data
/vagrant/event.sh finished!
Should have caught that myself, thanks. In my defense, however, I was pulling together the example event handler script from here and the example user event from here. Perhaps either serf should add a trailing newline for user events since all the other events seem to have them (though I could see scenarios where you may not want that), or the docs should flesh out this behavior a bit more with additional examples. Thoughts?
from serf.
I think I should make a note in the docs. Tagged. Thanks!
from serf.
Thanks for your crazy quick response!
from serf.
Fixed in abf697f
from serf.
FYI this appears to still be happening in 0.4.1. Below is an example.
Triggering the event:
# serf version
Serf v0.4.1
Agent Protocol: 3 (Understands back to: 1)
# serf event myevent "foo
> bar"
Event 'myevent' dispatched! Coalescing enabled: true
And the output of serf monitor -log-level=debug:
2014/02/12 23:25:32 [INFO] agent: Received event: user-event: myevent
Event Info:
Coalesce: true
Event: "user"
LTime: 9
Name: "myevent"
Payload: []byte{0x66, 0x6f, 0x6f, 0xa, 0x62, 0x61, 0x72}
2014/02/12 23:25:32 [DEBUG] Event 'user' script output:
/etc/serf/handlers/myevent.sh triggered!
SERF_EVENT is user
SERF_USER_EVENT is myevent
SERF_USER_LTIME is 9
BEGIN event data
foo
END event data
/etc/serf/handlers/myevent.sh finished!
And the handler script itself:
#!/bin/bash
echo
echo "$0 triggered!"
echo
echo "SERF_EVENT is ${SERF_EVENT}"
echo "SERF_USER_EVENT is ${SERF_USER_EVENT}"
echo "SERF_USER_LTIME is ${SERF_USER_LTIME}"
echo
echo "BEGIN event data"
while read line; do
echo $line
done
echo "END event data"
echo "$0 finished!"
echo
from serf.
This was indeed a regression. Fixed in a07ad67.
from serf.
Thanks!
from serf.
Related Issues (20)
- maybe mark `v0.9.6` as the latest release?
- Release latest binaries HOT 2
- response size check on keyListResponseWithCorrectSize breaks with 32bit keys and keyring size >20
- Data race related to query Ack channel
- Is Serf suitable for integration into the kubernetes app as a library?
- When the nodes leave and start at the same time in a large-capacity consul cluster, some member states will continue to keep leaving, not alive.
- Upgrade kramdown package used in Website Gemfile.lock to version 2.3.0+ to fix Remote Code Execution CVE-2020-14001
- Can't bind Serf agent to IPv6 address
- serf panics on MacOS when waking up from sleep during a network switch
- serf agent panic when -iface and -discover is given HOT 2
- serf: protect field access with lock to avoid potential data race
- [Question] User events to a node rejoining the cluster
- Is this a small typo? Should read start and stop?
- Please, Upgrade armon/go-metrics to hashicorp/go-metrics HOT 2
- Question regarding the estimation of the latency between two kubernetes clusters using serf
- Unix Domain Sockets for the RPC address.
- Using as a library of managing membership, Is serf just provides a different/better implementation of memberlist? HOT 2
- Unable to Access Vivaldi Coordinates HOT 2
- Connected node would remain in "alive" state indefinitely after unplugging Ethernet cable connecting two agents HOT 1
- Build fails with Go 1.23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serf.