Re logging, is it possible to turn it on/off, delete all logs in one stroke?
Logs
do you mean deleting all e.g /var/log/s6serv/daemon/current file for all daemon?
Maybe my answer will be out of field....
Note : i assume that you use the new version of s6-boot, adapt the default path if it's not the case (for remember, /run/boot/service for root was previously /run/user/master/classic)
Note : all s6 software need to find an absolute path (not the case with s6opts)
Note : replace foo term by the name of your daemon.
Maybe my answer will be out of field....
Note : i assume that you use the new version of s6-boot, adapt the default path if it's not the case (for remember, /run/boot/service for root was previously /run/user/master/classic)
Note : all s6 software need to find an absolute path (not the case with s6opts)
Note : replace foo term by the name of your daemon.
- for classic service :
Well, to make a rotation of a log :
this will make a backup of the current file and create a new empty current file# s6-svc -a /run/boot/service/foo/log
to turn off the daemon's log
this will stop the log daemon but it will be restarted at every boot.# s6-svc -d /run/boot/service/foo/log
to permanently remove the log :
remove the directory at /etc/s6-serv/available/classic/foo/log, then enable it again
answer y for all question asked by s6opts# s6opts enable foo
note : if the daemon is updated by pacman the log directory will appear again. if you want to have your own version you need to copy the original one and paste it at the same place with a different name.
to have the daemon log enabled at boot time but not started :
create an empty file called down at /etc/s6-serv/available/classic/foo/log directory and enable again the daemon foo with s6opts
to remove all current file :
note : this will cause trouble because if the daemon log is enabled it will not create automatically a current file deleted manualy and so....# find /var/log/s6serv -name current -exec rm {} \
- for rc service :
to rotate the log :
to stop the log :# s6-svc -a /run/boot/master-foo-log
to have the daemon log enabled at boot time but not started :# s6opts down master-foo-log
create an empty file called down at /etc/s6-serv/available/rc/foo-log directory then update your current database with :
if the daemon is already enabled the daemon will be removed, do again the same command to enable it again (This behaviour will be changed with the replacement of s6opts)# s6opts update foo
to remove all current file :
note : this will cause trouble because if the daemon log is enabled it will not create automatically a current file deleted manualy and so....# find /var/log/s6rc -name current -exec rm {} \
- Edited
Thank you for your detailed reply.
Yes, I use the new version of s6-boot.
If the system runs smoothly, I'd prefer to have no any logs at all (or maybe, optionally to send them all to >/dev/null). But in case logs are needed, it would be an option to turn them on.
Also, logs grow with time. Maybe, it's possible to zero log size automatically?
And how do you handle your logs?
Yes, I use the new version of s6-boot.
If the system runs smoothly, I'd prefer to have no any logs at all (or maybe, optionally to send them all to >/dev/null). But in case logs are needed, it would be an option to turn them on.
Also, logs grow with time. Maybe, it's possible to zero log size automatically?
And how do you handle your logs?
If yes, what would happen?do you mean deleting all e.g /var/log/s6serv/daemon/current file for all daemon?
the rotation and the size of the log file is controled by the run file in the log directory e.gAlso, logs grow with time. Maybe, it's possible to zero log size automatically?
And how do you handle your logs?
# !/usr/local/bin/execlineb -P
s6-setuidgid s6log
exec -c
s6-log n3 t s1000000 /var/log/s6serv/foo
n3 means that you keep 3 archived log files. If there are more, the oldest archived log files will be suppressed. If you want more/less archived file, change this number.s1000000 represent the size of the file (current file) in bytes. If you want a bigger/smaller current file size, change this number.
Also, refer here for more details about s6-log : https://skarnet.org/software/s6/s6-log.html.
the s6-log will not work properly as long as it will not be restarted cause of the missing file current.If yes, what would happen?
There is a quote from https://skarnet.org/software/s6/s6-log.html : "...If you have no disk to even write the current files to, write to a small RAM filesystem."
Any ideas how to write /var/log correctly to a small RAM filesystem?
Any ideas how to write /var/log correctly to a small RAM filesystem?
the /run directory is a RAM filesystem.
https://wiki.archlinux.org/index.php/tmpfs
https://wiki.archlinux.org/index.php/tmpfs