Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1134738

Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB

From Helmut Grohne <helmut@subdivi.de>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB
Date 2023-01-25 06:50 +0100
Message-ID <FRGPv-YsD-1@gated-at.bofh.it> (permalink)
References (3 earlier) <FRd17-EZQ-23@gated-at.bofh.it> <FRxVU-SYj-7@gated-at.bofh.it> <FRzbj-TF1-3@gated-at.bofh.it> <FKbGN-fwqT-3@gated-at.bofh.it> <FRzbj-TF1-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Hi Helge,

On Tue, Jan 24, 2023 at 10:30:37PM +0100, Helge Deller wrote:
> On 1/24/23 06:27, Helmut Grohne wrote:
> > On Mon, Jan 23, 2023 at 10:48:27PM +0100, Helge Deller wrote:
> > > --- ./init.org	2023-01-23 21:40:33.079738389 +0000
> > > +++ ./init	2023-01-23 21:40:45.983861851 +0000
> > > @@ -205,6 +205,15 @@ else
> > >   	resume=${RESUME:-}
> > >   fi
> > > 
> > > +if [ -z "${RUNSIZE}" ] || [[ "${RUNSIZE}" \< "20" ]]; then
> > 
> > This is as bashism and init runs with dash as far as I can see.
> 
> Hmm... I did tested it, at it seemed to work...
> Which part of that line exactly do you think is problematic?
> I'm open for any other idea how to code it.

The lexicographic comparison is outside the realm of POSIX shell, but to
my surprise this actually is supported by dash. So fixing this would be
academic.

> Both will work, because I assume that on such systems you probably have more than 200MB RAM
> and thus my patch won't touch the user-provided value at all.

Fair enough.

> > > +	read MemTotal mem_kb rest < /proc/meminfo
> > > +	# systemd requires at minumum 16MB for /run, so reserve
> > > +	# 20MB for machines which have less than 200MB RAM
> > > +	if [ "$mem_kb" -lt "200000" ]; then
> > > +		RUNSIZE=20M	# for machines <= 200MB RAM

else
	: "${RUNSIZE:=10%}"

> > 
> > Given that you initialize a default here, I think it would make the code
> > more obvious if you pulled the 10% default 4 lines later into an else
> > branch.
> 
> Not sure I understand this...?
> 
> > > +	fi
> > > +fi
> > > +
> > >   mount -t tmpfs -o "nodev,noexec,nosuid,size=${RUNSIZE:-10%},mode=0755" tmpfs /run

This is the other line that contains a default. I suggested moving this
default up to make it more obvious, but this is really only a cosmetic
improvement.

As such LGTM, but I am not an initramfs maintainer.

Helmut

Back to linux.debian.bugs.dist | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helge Deller <deller@gmx.de> - 2023-01-04 14:10 +0100
  Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helmut Grohne <helmut@subdivi.de> - 2023-01-04 14:40 +0100
    Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helge Deller <deller@gmx.de> - 2023-01-04 17:20 +0100
      Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helge Deller <deller@gmx.de> - 2023-01-23 23:00 +0100
        Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helmut Grohne <helmut@subdivi.de> - 2023-01-24 21:20 +0100
          Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helge Deller <deller@gmx.de> - 2023-01-24 22:40 +0100
            Bug#1027915: systemd requires /run to be mounted with a minimum size of 20MB Helmut Grohne <helmut@subdivi.de> - 2023-01-25 06:50 +0100

csiph-web