Skip to content

Instantly share code, notes, and snippets.

@rbrenton
Last active November 28, 2017 21:19
Show Gist options
  • Save rbrenton/255ac1e700b4e2fadcd790863eaa7033 to your computer and use it in GitHub Desktop.
Save rbrenton/255ac1e700b4e2fadcd790863eaa7033 to your computer and use it in GitHub Desktop.
Fix issue on Amazon Ubuntu 16.04 instances where datetime errors are flooding awslog.log
#!/bin/bash
# Fix for Ubuntu 16.04
# Stop
if [ -e /etc/init.d/awslogs ]
then
/etc/init.d/awslogs stop
fi
# Update
if [ ! -e /lib/systemd/system/awslogs.service ]
then
wget -O /lib/systemd/system/awslogs.service https://gist.githubusercontent.com/rbrenton/f1e5cac45b2da03eed0f04609898401a/raw/63ff14c8df75ac5d977854dec51871b26f04048b/awslogs.service
if [ -e /etc/init.d/awslogs ]
then
mv /etc/init.d/awslogs /etc/init.d/awslogs.orig
fi
systemctl enable awslogs.service
fi
# Fix
if [ ! -e /var/awslogs/bin/python.orig ]
then
cp /var/awslogs/bin/python /var/awslogs/bin/python.orig
cp /usr/bin/python2.7 /var/awslogs/bin/python
fi
# Start
systemctl start awslogs.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment