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


Groups > comp.os.linux.misc > #77470 > unrolled thread

Fixing ramdisk permissions.

Started byThe Natural Philosopher <tnp@invalid.invalid>
First post2025-11-13 10:50 +0000
Last post2025-11-13 19:56 +0000
Articles 10 — 5 participants

Back to article view | Back to comp.os.linux.misc


Contents

  Fixing ramdisk permissions. The Natural Philosopher <tnp@invalid.invalid> - 2025-11-13 10:50 +0000
    Re: Fixing ramdisk permissions. marrgol <marrgol@address.invalid> - 2025-11-13 13:19 +0100
      Re: Fixing ramdisk permissions. The Natural Philosopher <tnp@invalid.invalid> - 2025-11-13 15:15 +0000
        Re: Fixing ramdisk permissions. Rich <rich@example.invalid> - 2025-11-13 15:41 +0000
          Re: Fixing ramdisk permissions. The Natural Philosopher <tnp@invalid.invalid> - 2025-11-13 18:29 +0000
            Re: Fixing ramdisk permissions. vallor <vallor@vallor.earth> - 2025-11-13 18:55 +0000
              Re: Fixing ramdisk permissions. The Natural Philosopher <tnp@invalid.invalid> - 2025-11-13 19:04 +0000
                Re: Fixing ramdisk permissions. vallor <vallor@vallor.earth> - 2025-11-13 19:29 +0000
              Re: Fixing ramdisk permissions. John-Paul Stewart <jpstewart@personalprojects.net> - 2025-11-13 14:36 -0500
              Re: Fixing ramdisk permissions. Rich <rich@example.invalid> - 2025-11-13 19:56 +0000

#77470 — Fixing ramdisk permissions.

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2025-11-13 10:50 +0000
SubjectFixing ramdisk permissions.
Message-ID<10f4d5q$22lg1$6@dont-email.me>
To avoid logging to an SD card, my PI zero creates a ramdisk for logging

fstab:

tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0

Now logrotate is complaining that 'parent directory is insecure'
And I cant find a simple explanation of how the permissions on the 
parent stub interact with the permissions on a file system that doesn't 
exist at boot point...

Or what logrotate actually needs...

...any takers?

-- 
“It is not the truth of Marxism that explains the willingness of 
intellectuals to believe it, but the power that it confers on 
intellectuals, in their attempts to control the world. And since...it is 
futile to reason someone out of a thing that he was not reasoned into, 
we can conclude that Marxism owes its remarkable power to survive every 
criticism to the fact that it is not a truth-directed but a 
power-directed system of thought.”
Sir Roger Scruton

[toc] | [next] | [standalone]


#77474

Frommarrgol <marrgol@address.invalid>
Date2025-11-13 13:19 +0100
Message-ID<10f4ida$24rf4$1@dont-email.me>
In reply to#77470
On 2025-11-13 at 11:50 The Natural Philosopher wrote:
> 
> To avoid logging to an SD card, my PI zero creates a ramdisk for logging
> 
> fstab:
> 
> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0     0
> 
> Now logrotate is complaining that 'parent directory is insecure'

Might be the permissions of /var/ramlog -- logrotate wants it not writeable
by world and group (unless it's root).

[toc] | [prev] | [next] | [standalone]


#77481

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2025-11-13 15:15 +0000
Message-ID<10f4sls$27j7q$2@dont-email.me>
In reply to#77474
On 13/11/2025 12:19, marrgol wrote:
> On 2025-11-13 at 11:50 The Natural Philosopher wrote:
>>
>> To avoid logging to an SD card, my PI zero creates a ramdisk for logging
>>
>> fstab:
>>
>> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0     0
>>
>> Now logrotate is complaining that 'parent directory is insecure'
> 
> Might be the permissions of /var/ramlog -- logrotate wants it not writeable
> by world and group (unless it's root).
> 
> 
Well it is, because I fixed the access yesterday with chmod, ...

drwxr-xr-x  2 root root           400 Nov 13 00:00 ramlog

and now logrotate is chuffing away OK

$ ls -l /var/ramlog
total 4768
-rw-r----- 1 root adm    30823 Nov 13 15:09 auth.log
-rw-r----- 1 root adm  1229026 Nov 12 23:59 auth.log.1
-rw-r----- 1 root adm    31280 Nov 13 15:10 daemon.log
-rw-r----- 1 root adm  1358693 Nov 13 00:00 daemon.log.1
-rw-r----- 1 root adm        0 Nov 13 00:00 debug
-rw-r----- 1 root adm     3111 Oct 18 15:08 debug.1
-rw-r----- 1 root adm      241 Nov 13 00:00 error.log
-rw-r--r-- 1 root root    4096 Nov 13 00:00 error.log.1
-rw-r----- 1 root adm        0 Nov 13 00:00 kern.log
-rw-r----- 1 root adm    31018 Oct 18 15:08 kern.log.1
-rw-r----- 1 root adm        0 Nov 13 00:00 mail.info
-rw-r----- 1 root adm      216 Oct 18 15:08 mail.info.1
-rw-r----- 1 root adm        0 Nov 13 00:00 mail.log
-rw-r----- 1 root adm      216 Oct 18 15:08 mail.log.1
-rw-r----- 1 root adm      159 Nov 13 00:10 messages
-rw-r----- 1 root adm    30204 Oct 18 15:08 messages.1
-rw-r----- 1 root adm    48723 Nov 13 15:10 syslog
-rw-r----- 1 root adm  2083173 Nov 13 00:00 syslog.1


So I have *temporarily * fixed the problem till the next reboot.

What I want is for ramlog to be created with these permissions next 
boot, but I don't know how to ensure that.

PS ramdisk logging  is simply a great way to run PIs with SD cards.

-- 
You can get much farther with a kind word and a gun than you can with a 
kind word alone.

Al Capone


[toc] | [prev] | [next] | [standalone]


#77483

FromRich <rich@example.invalid>
Date2025-11-13 15:41 +0000
Message-ID<10f4u79$27vee$1@dont-email.me>
In reply to#77481
The Natural Philosopher <tnp@invalid.invalid> wrote:
> So I have *temporarily * fixed the problem till the next reboot.
> 
> What I want is for ramlog to be created with these permissions next 
> boot, but I don't know how to ensure that.

How (i.e., what steps occur) is /var/ramlog created as part of the boot 
process.

[toc] | [prev] | [next] | [standalone]


#77487

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2025-11-13 18:29 +0000
Message-ID<10f582j$2ba8l$4@dont-email.me>
In reply to#77483
On 13/11/2025 15:41, Rich wrote:
> The Natural Philosopher <tnp@invalid.invalid> wrote:
>> So I have *temporarily * fixed the problem till the next reboot.
>>
>> What I want is for ramlog to be created with these permissions next
>> boot, but I don't know how to ensure that.
> 
> How (i.e., what steps occur) is /var/ramlog created as part of the boot
> process.
an entry in fstab:

tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0

-- 
“it should be clear by now to everyone that activist environmentalism 
(or environmental activism) is becoming a general ideology about humans, 
about their freedom, about the relationship between the individual and 
the state, and about the manipulation of people under the guise of a 
'noble' idea. It is not an honest pursuit of 'sustainable development,' 
a matter of elementary environmental protection, or a search for 
rational mechanisms designed to achieve a healthy environment. Yet 
things do occur that make you shake your head and remind yourself that 
you live neither in Joseph Stalin’s Communist era, nor in the Orwellian 
utopia of 1984.”

Vaclav Klaus

[toc] | [prev] | [next] | [standalone]


#77489

Fromvallor <vallor@vallor.earth>
Date2025-11-13 18:55 +0000
Message-ID<10f59ib$2b1bt$3@dont-email.me>
In reply to#77487
At Thu, 13 Nov 2025 18:29:39 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:

> On 13/11/2025 15:41, Rich wrote:
> > The Natural Philosopher <tnp@invalid.invalid> wrote:
> >> So I have *temporarily * fixed the problem till the next reboot.
> >>
> >> What I want is for ramlog to be created with these permissions next
> >> boot, but I don't know how to ensure that.
> > 
> > How (i.e., what steps occur) is /var/ramlog created as part of the boot
> > process.
> an entry in fstab:
> 
> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0

Perhaps add a "mode=0755" to the mount options?

-- 
-v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090Ti 24G
   OS: Linux 6.18.0-rc5 D: Mint 22.2 DE: Xfce 4.18 
   NVIDIA: 580.105.08 Mem: 258G
   "It's not hard to meet expenses, they're everywhere!"

[toc] | [prev] | [next] | [standalone]


#77490

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2025-11-13 19:04 +0000
Message-ID<10f5a3k$2ba7v$1@dont-email.me>
In reply to#77489
On 13/11/2025 18:55, vallor wrote:
> At Thu, 13 Nov 2025 18:29:39 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> On 13/11/2025 15:41, Rich wrote:
>>> The Natural Philosopher <tnp@invalid.invalid> wrote:
>>>> So I have *temporarily * fixed the problem till the next reboot.
>>>>
>>>> What I want is for ramlog to be created with these permissions next
>>>> boot, but I don't know how to ensure that.
>>>
>>> How (i.e., what steps occur) is /var/ramlog created as part of the boot
>>> process.
>> an entry in fstab:
>>
>> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0
> 
> Perhaps add a "mode=0755" to the mount options?
> 
That works?


-- 
"I am inclined to tell the truth and dislike people who lie consistently.
This makes me unfit for the company of people of a Left persuasion, and 
all women"

[toc] | [prev] | [next] | [standalone]


#77492

Fromvallor <vallor@vallor.earth>
Date2025-11-13 19:29 +0000
Message-ID<10f5bjh$2b1bt$4@dont-email.me>
In reply to#77490
At Thu, 13 Nov 2025 19:04:20 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:

> On 13/11/2025 18:55, vallor wrote:
> > At Thu, 13 Nov 2025 18:29:39 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:
> > 
> >> On 13/11/2025 15:41, Rich wrote:
> >>> The Natural Philosopher <tnp@invalid.invalid> wrote:
> >>>> So I have *temporarily * fixed the problem till the next reboot.
> >>>>
> >>>> What I want is for ramlog to be created with these permissions next
> >>>> boot, but I don't know how to ensure that.
> >>>
> >>> How (i.e., what steps occur) is /var/ramlog created as part of the boot
> >>> process.
> >> an entry in fstab:
> >>
> >> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0
> > 
> > Perhaps add a "mode=0755" to the mount options?
> > 
> That works?

Yes.  (Just tested it just to make sure.)

You should have a man page for tmpfs with all the mount options.

-- 
-v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090Ti 24G
   OS: Linux 6.18.0-rc5 D: Mint 22.2 DE: Xfce 4.18 
   NVIDIA: 580.105.08 Mem: 258G
   "I wish life had a scroll-back buffer....."

[toc] | [prev] | [next] | [standalone]


#77493

FromJohn-Paul Stewart <jpstewart@personalprojects.net>
Date2025-11-13 14:36 -0500
Message-ID<mnmq9cFpj1eU1@mid.individual.net>
In reply to#77489
On 2025-11-13 1:55 p.m., vallor wrote:
> At Thu, 13 Nov 2025 18:29:39 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> On 13/11/2025 15:41, Rich wrote:
>>> The Natural Philosopher <tnp@invalid.invalid> wrote:
>>>> So I have *temporarily * fixed the problem till the next reboot.
>>>>
>>>> What I want is for ramlog to be created with these permissions next
>>>> boot, but I don't know how to ensure that.
>>>
>>> How (i.e., what steps occur) is /var/ramlog created as part of the boot
>>> process.
>> an entry in fstab:
>>
>> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0 	0
> 
> Perhaps add a "mode=0755" to the mount options?

It is also possible to add gid=xxx so that it is owned by group adm.  I
think xxx would need be to the numeric group id of adm rather than the
group name.  (At least all my tmpfs mounts use numeric uids and gids
where they're necessary.)

[toc] | [prev] | [next] | [standalone]


#77494

FromRich <rich@example.invalid>
Date2025-11-13 19:56 +0000
Message-ID<10f5d4o$2d3aa$1@dont-email.me>
In reply to#77489
vallor <vallor@vallor.earth> wrote:
> At Thu, 13 Nov 2025 18:29:39 +0000, The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> On 13/11/2025 15:41, Rich wrote:
>> > The Natural Philosopher <tnp@invalid.invalid> wrote:
>> >> So I have *temporarily * fixed the problem till the next reboot.
>> >>
>> >> What I want is for ramlog to be created with these permissions next
>> >> boot, but I don't know how to ensure that.
>> > 
>> > How (i.e., what steps occur) is /var/ramlog created as part of the boot
>> > process.
>> an entry in fstab:
>> 
>> tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M   0   0
> 
> Perhaps add a "mode=0755" to the mount options?

This is the solution.  Adjust the "0755" to get your desired 
permissions for the root of the mount.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.misc


csiph-web