Git Product home page Git Product logo

Comments (7)

dw-0 avatar dw-0 commented on May 30, 2024 1

Okay so i thought a bit about this feature and i came to the conclusion that i won't implement it.

I don't see a benefit for the majority of users at the moment (might be due to own restricted knowledge in that regard). What is the actual benefit regarding the wear of the sd card? Is it safe to always delete the printer symlink in the tmp folder? Does it get recreated everytime the klipper service starts again (i haven't tested, and i don't want to tbh)? Questions i have no answer to, possible causes for some issues i (or rather kiauh) don't want to be the reason for.

And to be honest i don't want my script to write into any important system files, add lines, change lines or delete lines. Those are things i consider to be made by power-users themself if they want. I want to interact with the core linux os as few as possible.

I might add those tips to my readme though if you want, under a section "further tweaks" or so?

from kiauh.

vladbabii avatar vladbabii commented on May 30, 2024

The memory usage can be kept low by rotating logs with logrotate

create file

/etc/logrotate.d/klipper

with contents

/tmp/*.log
{
  size 1M
  copytruncate
  rotate 0
  su pi pi
}

Change size from 1M to something more appropiate

from kiauh.

dw-0 avatar dw-0 commented on May 30, 2024

Haven't you had some problems with logs missing and then Nginx not working properly anymore? I think i red something like that on discord? I really don't want to include functions which can cause further, somehwhat unpredictable problems.

Maybe a better solution would be, to add only klippy.log and moonraker.log to the tmpfs if the user wants? And not the whole tmp-folder? That might work because those files are always created when the services start up, no matter if it already exists or not. And actually it would make sense to me, deleting those files regularly. This klippy.log can get quite bloated.

from kiauh.

vladbabii avatar vladbabii commented on May 30, 2024

You can set nginx logs from

/var/log/ngix/something.log
to
/var/log/nginx_something.log

or add an

mkdir /var/log/nginx/
in the startup sequence or

add in fstab

tmpfs /var/log/nginx tmpfs defaults,noatime,nodev,nosuid,size=10M 0 0

from kiauh.

vladbabii avatar vladbabii commented on May 30, 2024

I also added a file in

/etc/logrotate.d/klipper

with

/tmp/*.log
{
  size 1M
  copytruncate
  rotate 0
  su pi pi
}

which makes sure logs aren't filled up

from kiauh.

vladbabii avatar vladbabii commented on May 30, 2024

I've also ran printers off read only filesystems except a small partition for gcode files to upload to (or used an usb stick for that). Those printers had zero filesystem issues and are workhoses. No corruption or broken files. Upgrading is a bit more comples, you need to ssh in, run a command like "root-rw on", then do upgrade, then "root-rw off" the turn it read-only

from kiauh.

vladbabii avatar vladbabii commented on May 30, 2024

Ok.

The benefit is a longer lifetime for the sd card. On all my PIs that run critical stuff the filesystem is fully read only and they write into tmpfs. I've got a couple running for over 4 years under a great number of random power failures and other issues. Cheap sd cards work well for 2-3 months at most, if you write to them a lot of logs and good ones are from 4 to 12 months, but they usually cost 5-10x the price.

from kiauh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.