Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Mount logs in tmpfs #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/modules/fluidd/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ su -c "unzip fluidd.zip -d /home/pi/fluidd" - pi
rm /home/pi/fluidd.zip

# link logfiles to klipper_logs
ln -s /var/log/nginx/fluidd-access.log /home/pi/klipper_logs/
ln -s /var/log/nginx/fluidd-error.log /home/pi/klipper_logs/
ln -s /var/log/nginx/fluidd-access.log /var/log/klipper/
ln -s /var/log/nginx/fluidd-error.log /var/log/klipper/

# Run installation steps defined above

# Unpack root at the end, so files are modified before
unpack /filesystem/root /
unpack /filesystem/root /
5 changes: 2 additions & 3 deletions src/modules/klipper/filesystem/root/etc/logrotate.d/klipper
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

/home/pi/klipper_logs/klippy.log
/var/log/klipper/klippy.log
{
rotate 7
daily
maxsize 64M
maxsize 16M
missingok
notifempty
compress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ WantedBy=multi-user.target
Type=simple
User=pi
RemainAfterExit=yes
ExecStart=/home/pi/klippy-env/bin/python /home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /home/pi/klipper_logs/klippy.log -a /tmp/klippy_uds
ExecStart=/home/pi/klippy-env/bin/python /home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /var/log/klipper/klippy.log -a /tmp/klippy_uds
Restart=always
RestartSec=10
RestartSec=10
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d /var/log/klipper 0755 pi pi - -
10 changes: 9 additions & 1 deletion src/modules/klipper/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ cd /home/pi
gitclone KLIPPER_REPO klipper

[ ! -d /home/pi/klipper_config ] && su -c "mkdir /home/pi/klipper_config" - pi
[ ! -d /home/pi/klipper_logs ] && su -c "mkdir /home/pi/klipper_logs" - pi

# mount rotate files in RAM
# tmpfs /var/log tmpfs nodev,nosuid 0 0
# tmpfs /var/tmp tmpfs nodev,nosuid 0 0
# tmpfs /tmp tmpfs nodev,nosuid 0 0
append1 /etc/fstab "/var/log" "tmpfs /var/log tmpfs nodev,nosuid 0 0"
append1 /etc/fstab "/var/tmp" "tmpfs /var/tmp tmpfs nodev,nosuid 0 0"
append1 /etc/fstab "\s/tmp" "tmpfs /tmp tmpfs nodev,nosuid 0 0"


# create python virtualenv and install klipper requirements
su -c "virtualenv -p python2 ${KLIPPER_PYTHON_DIR}" - pi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

/var/log/webcamd.log
{
rotate 4
weekly
maxsize 64M
maxsize 16M
missingok
notifempty
compress
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
L /var/log/klipper/webcamd.log - - - - /var/log/webcamd.log
3 changes: 0 additions & 3 deletions src/modules/mjpgstreamer/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ fi
apt-get clean
apt-get autoremove -y

# link logfiles to klipper_logs
ln -s /var/log/webcamd.log /home/pi/klipper_logs/

# Run installation steps defined above

# Unpack root at the end, so files are modified before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enable_debug_logging: False
config_path: ~/klipper_config
temperature_store_size: 600
gcode_store_size: 1000
log_path: ~/klipper_logs
log_path: /var/log/klipper

[authorization]
force_logins: True
Expand Down Expand Up @@ -37,4 +37,4 @@ enable_auto_refresh: True
[update_manager client fluidd]
type: web
repo: fluidd-core/fluidd
path: ~/fluidd
path: ~/fluidd
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

/home/pi/klipper_logs/moonraker.log
/var/log/klipper/moonraker.log
{
rotate 7
daily
maxsize 64M
maxsize 16M
missingok
notifempty
compress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ WantedBy=multi-user.target
Type=simple
User=pi
RemainAfterExit=yes
ExecStart=/home/pi/moonraker-env/bin/python /home/pi/moonraker/moonraker/moonraker.py -c /home/pi/klipper_config/moonraker.conf -l /home/pi/klipper_logs/moonraker.log
ExecStart=/home/pi/moonraker-env/bin/python /home/pi/moonraker/moonraker/moonraker.py -c /home/pi/klipper_config/moonraker.conf -l /var/log/klipper/moonraker.log
Restart=always
RestartSec=10
RestartSec=10