digitalocean / droplet-agent

Droplet Agent is the daemon that runs on customer droplets to enable some features such as web console access.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Append to log and timestamped entries

iosonogio opened this issue · comments

Sometimes it happens that the droplet-agent update script fails with an error. This is reported by cron, but without any detail about the nature of the error (only "exited with return code 1"), yet we are not able to find this detail in the droplet-agent.update.log file because this file is overwritten by the script every time it runs.

root@debianbox:~# cat /etc/cron.hourly/droplet-agent 
#!/bin/sh
/bin/bash /opt/digitalocean/droplet-agent/scripts/update.sh >/var/log/droplet-agent.update.log 2>&1

If there was a one-time error in the middle of the night, even though it may have solved in the subsequent runs, it would still be useful to know the reason of the error.

So my proposal is to have the update script append to the log file instead of overwriting it every time.

Moreover, I would like to propose to review the scripts so that timestamps are written in the log file as well, this is important for troubleshooting.

Than you!