This file contains 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
import http.server | |
import socketserver | |
import subprocess | |
PORT = 8000 | |
REQUEST_TIMEOUT = 600 | |
SCRIPT = "/home/ubuntu/test.sh" | |
class MyHandler(http.server.SimpleHTTPRequestHandler): |
This file contains 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
{ | |
"CurrentDeliveryStreamVersionId": "Obtain this value from the VersionId result of DeliveryStreamDescription. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, the VersionId value is updated. The service then performs a merge of the old configuration with the new configuration.", | |
"DeliveryStreamName": "The name of the delivery stream.", | |
"DestinationId": "The ID of the destination.", | |
"ElasticsearchDestinationUpdate": { | |
"BufferingHints": { | |
"IntervalInSeconds": "Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300 (5 minutes).", | |
"SizeInMBs": "Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. \nWe recommend setting this parameter to a value greater than the |
This file contains 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 | |
process="your-process-here" | |
run_command="command to start the process" | |
time_check="5" # time to check in sec. | |
while true ; do | |
proc_count=$(ps xa | grep -v grep | grep "$process" | wc -l) | |
if [ "$proc_count" == 0 ]; then | |
$run_command |
This file contains 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
Cloud-init v. 0.7.5 running 'modules:config' at Wed, 12 Aug 2015 14:06:28 +0000. Up 17.07 seconds. | |
2015-08-12 14:06:28,506 - util.py[WARNING]: Activating mounts via 'mount -a' failed | |
Generating locales... | |
en_US.UTF-8... up-to-date | |
Generation complete. | |
Cloud-init v. 0.7.5 running 'modules:final' at Wed, 12 Aug 2015 14:06:31 +0000. Up 20.04 seconds. | |
Starting: 2015-08-12 14:06:31 | |
Wait 10 sec. for volumes detection... | |
Prepare Volumes | |
2015-08-12 14:06:41,297 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1] |