Hi
I have tried to create a custom addon, raspap, which I will want to run with it’s own USB wlan and lan adapter. It doesn’t need to talk to HA in anyway. I just want the dockerfile to run on the same Pi and give it access to the USB ports.
There is a docker image available for RaspAP, which I want to use as the base image for the Addon.
ARG BUILD_FROM
FROM ghcr.io/raspap/raspap-docker:latest
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
run.sh
#!/usr/bin/with-contenv bashio
# Make cgroups writable for ARM devices
mkdir -p /sys/fs/cgroup
mount -t tmpfs -o remount,rw /sys/fs/cgroup
# Run RaspAP
/usr/sbin/raspap.sh
So I have made some… progress in trying to get the RaspAP dockerfile running within home assistant (HA) as an addon. Still, there is no need for it to talk to HA in anyway.
Now my dockerfile
ARG BUILD_FROM
FROM ghcr.io/raspap/raspap-docker:latest
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD ["/run.sh"]
However, raspAP does not run in the container. It should start on startup, but
when I ssh into HA and enter the container and start raspAp manually I get this exchange:
➜ ~ docker exec -it addon_local_raspap /bin/bash
root@local-raspap:/# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2316 1152 ? Ss 11:27 0:00 /bin/sh /run.sh
root 7 0.0 0.0 2252 1024 ? S 11:27 0:00 tail -f /dev/null
root 8 0.0 0.0 4052 3200 pts/2 Ss 11:31 0:00 /bin/bash
root 14 0.0 0.0 8160 3712 pts/2 R+ 11:32 0:00 ps aux
root@local-raspap:/# /bin/bash /etc/raspap/hostapd/servicestart.sh --interface uap0 --seconds 3
Stopping network services...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Changing RaspAP Daemon --interface to uap0
Starting network services...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
RaspAP service start DONE
root@local-raspap:/# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2316 1152 ? Ss 11:27 0:00 /bin/sh /run.sh
root 7 0.0 0.0 2252 1024 ? S 11:27 0:00 tail -f /dev/null
root 8 0.0 0.0 4052 3200 pts/2 Ss 11:31 0:00 /bin/bash
root 29 0.0 0.0 8160 3712 pts/2 R+ 11:41 0:00 ps aux
root@local-raspap:/# ```
It seems, so far. To be a problem with "systemd" not working or being available for raspap in the container... I don't get it.
The container should work. It is a tested one from RaspAP. And also I have set
Without digging into your setup, that message tells that servicestart.sh is expecting that systemd is present and running, while it is not.
You probably just need to start the main application some other “manual” way.
Thank you. I tried this by replicate whatever is being done to start raspap. But it’s pretty complicated.
Why does systemd not work? Is there anyway to make systemd work inside a container inside HA?
If you hate complications, you’ll definitely hate trying to run systemd inside a container
Systemd is meant as a generic system (i.e. bare metal or VM) hypervisor of sorts.
A docker image is supposed to be the opposite of generic, super specific.
You can google docker systemd to have an idea, but it definitely is far easier to mimic what servicestart.sh does in your Dockerfile’s ENTRYPOINT and/or CMD.
P.S. I’m talking docker in general, here. There are some specifics to HA addons as well, IIRC. Not sure using ghcr.io/raspap/raspap-docker as the base image will ever work.
You might want to start from ghcr.io/hassio-addons/base then add raspap on top.
Yes, I guess you are right. I came to think they did by my own, clumsy, research. Found a file called raspap.service which in turn uses the servicestart.sh file which relies on systemd. So I tried use it too…
I asked in the github of the docker image. Somehow I just can’t completely let go of this yet…