DEV Work in progress: Upgrade emonSD to Raspbian Stretch (Raspberry Pi 3B+)

Following on from the excellent thread pioneered by @Paul with input from many others:

I’ve had a go at upgrading the existing emonSD image from Jessie > Stretch so I can test running on a Raspberry Pi 3B+. The 3B+ only supports Stretch.

I’ve been documenting my progress here: Create new page · openenergymonitor/emonpi Wiki · GitHub

All seems to be going well, one issue I’ve hit is that apache2 doesn’t want to run when in RO mode. It runs fine when in RW mode. The logs don’t give any indication as to why it won’t run, or what file it’s failing to write. Any ideas?

pi@emonpi(ro):~$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: resources)

May 17 15:30:24 emonpi systemd[1]: apache2.service: Failed with result 'resources'.
May 17 15:37:25 emonpi systemd[1]: apache2.service: Failed to run 'start' task: Read-only file system
May 17 15:37:25 emonpi systemd[1]: Failed to start The Apache HTTP Server.
May 17 15:37:25 emonpi systemd[1]: apache2.service: Failed with result 'resources'.
May 17 15:47:09 emonpi systemd[1]: apache2.service: Failed to run 'start' task: Read-only file system
May 17 15:47:09 emonpi systemd[1]: Failed to start The Apache HTTP Server.
May 17 15:47:09 emonpi systemd[1]: apache2.service: Failed with result 'resources'.
May 17 15:49:35 emonpi systemd[1]: apache2.service: Failed to run 'start' task: Read-only file system
May 17 15:49:35 emonpi systemd[1]: Failed to start The Apache HTTP Server.
May 17 15:49:35 emonpi systemd[1]: apache2.service: Failed with result 'resources'.
1 Like

Could it be related to this post?
It appears that apache grinds to a halt if it can’t write it’s tmp files.

Paul

Did you upgrade or start from scratch? Just interested…

YES! Good shout :+1: :tada: . It just needed /var/tmp to be mounted in tmpfs. I’ve documented my steps here Create new page · openenergymonitor/emonpi Wiki · GitHub

I upgraded from Jessie

Seems to be working well now. Need to do some further testing, still early days. I will try and release a beta emonSD Jessie image for testing soon.

If there is a general problem with temp files I came across systemd-tmpfilesrecently (not used it though).

@glyn.hudson, what is the rationale behind upgrading from Jessie, instead of starting with a clean ‘stretch’ OS?
I would have thought that the latter would be preferable…

Paul

2 Likes

There is another method for making an image for the Pi3B+ too - I do this with my own project;
Essentially you can drop the Stretch kernel, firmware and modules into Jessie, add the boot code from the new stretch build and have a working Jessie image on a Pi3B+

It may not be totally ideal for a long-term solution, but it will get you onto the Pi 3B+ hardware really quickly.

I went through this whole process a month ago but with a view to making the whole of var a tmpfs…

The reason for this is that strictly systemd requires /var to be RW . Largely everything works under this approach due to the systemd-itisation of Debian, but there are a few things which it broke which I think I have mostly fixed now.

One thing to note from this which may be relevant for what you are doing is that systemd has a facility for creating files at runtime called systemd-tmpfiles.

1 Like