mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-27 15:06:29 +00:00
Improve OS logging (#1590)
* Avoid duplicate log entries So far the hassos-supervisor.service starts the hassos-supervisor script which in turn attaches to the Supervisor container. This causes stdout and stderr to be forwarded to the service unit, which in turn logs it in the journal. However, Docker too logs all stdout/stderr to the journal through the systemd-journald log driver. Do not attach to the Supervisor container to avoid logging the Supervisor twice. Note that this no longer forwards signals to the container. However, the hassos-supervisor.service uses the ExecStop= setting to make sure the container gets gracefully stopped. * Use image and container name as syslog identifier By default Docker users the container id as syslog identifier. This leads to log messages which cannot easily be attributed to a particular container (since the container id is a random hex string). Use the image and container name as syslog identifier. Note that the Docker journald log driver still stores the container id as a separate field (CONTAINER_ID), in case the particular instance need to be tracked.
This commit is contained in:
parent
b211c653c7
commit
ce566167f2
@ -3,4 +3,4 @@ RequiresMountsFor=/etc/docker /mnt/data /var/lib/docker
|
||||
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/dockerd -H fd:// --cpu-rt-runtime=950000 --storage-driver=overlay2 --log-driver=journald --data-root /mnt/data/docker
|
||||
ExecStart=/usr/bin/dockerd -H fd:// --cpu-rt-runtime=950000 --storage-driver=overlay2 --log-driver=journald --log-opt tag="{{.ImageName}}/{{.Name}}" --data-root /mnt/data/docker
|
||||
|
@ -100,4 +100,5 @@ fi
|
||||
# Run supervisor
|
||||
mkdir -p ${SUPERVISOR_DATA}
|
||||
echo "[INFO] Starting the Supervisor..."
|
||||
exec docker container start --attach hassio_supervisor
|
||||
docker container start hassio_supervisor
|
||||
exec docker container wait hassio_supervisor
|
||||
|
Loading…
x
Reference in New Issue
Block a user