Re logging, is it possible to turn it on/off, delete all logs in one stroke?
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.
  • for classic service :


    Well, to make a rotation of a log :
    # s6-svc -a /run/boot/service/foo/log
    this will make a backup of the current file and create a new empty current file

    to turn off the daemon's log
    # s6-svc -d /run/boot/service/foo/log
    this will stop the log daemon but it will be restarted at every boot.

    to permanently remove the log :
    remove the directory at /etc/s6-serv/available/classic/foo/log, then enable it again
    # s6opts enable foo
    answer y for all question asked by s6opts
    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 :
    # find /var/log/s6serv -name current -exec rm {} \
    note : this will cause trouble because if the daemon log is enabled it will not create automatically a current file deleted manualy and so....
  • for rc service :


    to rotate the log :
    # s6-svc -a /run/boot/master-foo-log
    to stop the log :
    # s6opts down master-foo-log
    to have the daemon log enabled at boot time but not started :
    create an empty file called down at /etc/s6-serv/available/rc/foo-log directory then update your current database with :
    # s6opts update  foo
    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)


    to remove all current file :
    # find /var/log/s6rc -name current -exec rm {} \
    note : this will cause trouble because if the daemon log is enabled it will not create automatically a current file deleted manualy and so....
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?
do you mean deleting all e.g /var/log/s6serv/daemon/current file for all daemon?
If yes, what would happen?
Also, logs grow with time. Maybe, it's possible to zero log size automatically?
And how do you handle your logs?
the rotation and the size of the log file is controled by the run file in the log directory e.g
# !/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.
If yes, what would happen?
the s6-log will not work properly as long as it will not be restarted cause of the missing file current.

Powered by Obarun