ct-Open-Source / ct-Open-Source/ct-Smart-Home

Error when restarting nodered container: The pid file "/run/dbus/dbus.pid" exists

Open
#73 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
171
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm running ct-smart-home on a Pi 4 and I keep experiencing an issue where restarting the nodered container will fail.

`docker-compose ps` would tell me that nodered is `unhealthy` and nodered would not be accessible via the configured ports. `docker-compose logs nodered` would reveal that the container is stuck at the following point:
`dbus-daemon[10]: Failed to start message bus: The pid file "/run/dbus/dbus.pid" exists, if the message bus is not running, remove this file`.

[Looking at `entrypoint.sh`](https://github.com/ct-Open-Source/ct-Smart-Home/blob/1cfed9093cbaac4d8af0228e4380469d50a1526c/docker-image/entrypoint.sh#L2) reveals that prior to starting dbus `/var/run/dbus.pid` is indeed removed, but not `/run/dbus/dbus.pid`. Not sure if some update moved `dbus.pid` to the new location ...

I probably could edit `entrypint.sh` and build a custom docker image but atm I don't have the time, so I'm going with this quick & dirty workaround, which I apply manually whenever needed:

```bash
# container needs to run for this
docker-compose up -d nodered
# remove unhandled dbus pid file
docker-compose exec nodered sh -c 'su-exec root rm -f /run/dbus/dbus.pid'
# restart
docker-compose restart nodered
```

I would expect that adding somethin like the following line to `entrypoint.sh` would fix this issue, but I haven't verified it.
`[[ -e /run/dbus/dbus.pid ]] && su-exec root rm -f /run/dbus/dbus.pid`

Just wanted to share my observations at this point.

Cheers!

Edit:
Note that I added `container_name: nodered` to my `docker-compose.yml`, so you will need to adapt my docker-compose commands to your container name.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.