The officially official Devuan Forum!

You are not logged in.

#1 2024-07-28 05:18:25

jonny101
Member
Registered: 2024-06-20
Posts: 8  

log2ram with sysv

Hi everybody,

i just got Devuan working on my Odroid N2+ using the maveric image as starting point (works flawlessly 🥰).

Now in order to spare the eMMC I used to run log2ram on it but log2ram is dependent on systemd.
According to the developer it should also work with init.d only the init script is needed.

My question is, does anyone use log2ram with sysvinit or knows another simple tool I could use to write logs to ram? I have no experience with sysv so far and thought I'd ask before starting to tinker myself.

Thank you.

Offline

#2 2024-07-28 09:28:30

jonny101
Member
Registered: 2024-06-20
Posts: 8  

Re: log2ram with sysv

Okay after researching for another hour or so I found that log2ram is the successor of a project called transientlog which in turn was born out of an article from debian-administration.org called A transient /var/log - back in 2010 when systemd wasn't yet relevant.

Therefore I was able to apply transientlog almost without modification to my Devuan 5 install and for now it seems to work. It creates a RAM drive on startup and copies all log files into it. On shutdown/reboot it does the opposite. It copies all log files from the RAM drive to the eMMC card. The only thing I modified was the size of the RAM drive - from 25M to 90M because my log folder was already 38M in size.

I will keep monitoring the script to see if it is stable and report my findings.

Offline

#3 2024-11-13 07:53:00

cake
Member
Registered: 2024-11-13
Posts: 5  

Re: log2ram with sysv

Hi, thanks Jonny, I tried transientlog and had to modify the install script I believe (removed systemctl daemon-reload from install.sh, Anyway I got it to work, but it was unreliable after I installed fail2ban and ufw. It would work if I stopped, deleted the permanentlog file and started it again. So I went searching for someone who has got ram2log working for sysv and I found this > https://energytalk.co.za/t/gx-device-lo … g2ram/2130

I have 3 Arm sbc devices, one is a old bananapi pro. All are headless and have new fresh devuan installs on them. I followed the tutorial for log2ram above, it all went smooth, seems to work.
The other 2 smb's are located remotely and both running devuan daedalus as well. As I installed to the next one via ssh I did this too I thought this would work but it never came back after I rebooted (end of the install tutorial), so :-(

Maybe somebody here could look and suggest change(s) to that tutorial. I am not sure if I typed something wrong on my second device or not.
The only complaint during install was when entering this (both devices)- sudo update-rc.d log2ram-init.sh start 06 S . stop 80 0 6 . I got this: update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults otherwise no errors.

So maybe the tutorial works and maybe its doesn't. cheers

Edit: I just thought of this, On the bannanapro install, for root command I do not have to enter sudo first. Such as #findmnt on the other 2 I have to enter sudo first #sudo findmnt I wonder if this is my problem. The tutorial in link , he did say "IMPORTANT: Install findmnt - needed to log2ram core tool:"
hmmmmm

Edit#2: Actually after more digging around I can use findmnt (/sbin), but not anything located in /bin unless I type sudo first.
I bet that could be my problem

Edit#3: sleuthing around the internet today, I guess I should have used su - to get the correct path. I logged in as a normal user, then "su root" but I guess that is not enough, still need to su - first. Got the remote sbc rebooted and the root file system mounted.  Its just busybox inititramfs and dropbear right now. Log file doesn't have much of a clue. I'll get this eventually sorted out and post a reply here, so if it works then there is alternative beside transientlog.

Last edited by cake (2024-11-14 03:35:48)

Offline

#4 2024-12-27 01:00:31

cake
Member
Registered: 2024-11-13
Posts: 5  

Re: log2ram with sysv

I figured it out, need to to wait until file system in read write mode. Simple fix to add # Required-Start: $local_fs to file inside init.d

I posted a very quick tutorial of the tutorial I found at ...*edited: I put it on codeberg.org
running short on time today

https://codeberg.org/cake1/log2ram_SysV_Init

Last edited by cake (2024-12-28 00:29:39)

Offline

#5 2024-12-27 03:32:53

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,292  

Re: log2ram with sysv

Just a friendly reminer that It's Never Too Early to stop using Microsoft's github

Offline

#6 2024-12-27 04:37:21

cake
Member
Registered: 2024-11-13
Posts: 5  

Re: log2ram with sysv

Thanks Ralph, I am very much anti microsoft, google etc myself. Please suggest me a new place anyone?

Offline

#7 2024-12-27 04:44:30

RedGreen925
Member
Registered: 2024-12-07
Posts: 46  

Re: log2ram with sysv

Edit#3: sleuthing around the internet today, I guess I should have used su - to get the correct path.

From my install notes when I seen this come through.

SU changes not noticed here but may be in future so may as well set it up.

Changes in su
- The behavior of su has changed. Use 'su -' to get root's path or use
   the full path to commands if you use only 'su'.
    - There are several ways to get the old behavior. The easiest is to
   edit /etc/default/su to add the line:

    ALWAYS_SET_PATH yes

root@9600k:~# cat /etc/default/su
cat: /etc/default/su: No such file or directory
root@9600k:~# nano /etc/default/su
root@9600k:~# cat /etc/default/su
# Added to always have the PATH set for su.

ALWAYS_SET_PATH yes

You might want to create that file on your installs and install the lovely little program apt-listchanges which tells you thing like this when updating your packages..

Offline

#8 2024-12-27 12:08:11

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,292  

Re: log2ram with sysv

@cake, re git stores... nowadays I'd suggest codeberg.org
and you're of course also welcome at git.devuan.org

Offline

Board footer