|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
/var/log on tmpfs and missing log files
Hello,
I am experimenting with /var/log on tmpfs. I would like to have this directory in RAM and having it written to /var/log_backup at shutdown. I have done it putting script into /etc/rc.shutdown I know this is not so secure as having this on HDD all time, but for me probably will be enough. In future maybe I will further advance setup, add cron job to make backups hourly to HDD or something. Problem. Problem is that after boot I don't have some logs created. For example there is no /var/log/daemon and it seems after few minutes of working and issuing command like that: Code:
rcctl -f start ntpd go to /var/log/daemon, it is not here. Actually in /var/log I have only pflog and Xorg.0.log files. Is there a way configure system to make logs in this setup? |
|
|||
I am going to experiment with it in a few days, because I don't have much time today.
Does this -P option can be used via /etc/fstab? Because I mount /var/log via /etc/fstab. BTW For me it is weird that directory mounted early (I guess this is done early, if mounted by fstab) and log daemon doesn't create new, zero length file and doesn't log into it if it doesn't exist before. |
|
||||
Yes, see the fstab(5) man page, there is an example of an MFS filesystem using the -s option.
Quote:
You want to create your own, custom logging, in a fashion not intended by the Project's utilities. You're welcome to do so, as long as you are aware that what you want to accomplish is unsupported. You'll need to do this on your own. Should you decide to customize the rc(8) script, please note that this will be replaced with the Project's standard rc() script after any upgrade. |
|
|||
I have added in /etc/rc one line starting script which
extracts files from tar archive to /var/log mounted as tmpfs filesystem. Code:
$ grep -B1 'starting early daemons' /etc/rc /usr/sbin/wypadkuj_logi echo -n 'starting early daemons:' Code:
$ cat /usr/sbin/wypadkuj_logi #!/bin/ksh /bin/tar -xf /var/log_plik.tar -C / exit 0 Thanks for help. |
|
|||
tmpfs has been disabled so I needed to switch to mfs.
Code:
$ grep -B1 'starting early daemons' /etc/rc /usr/sbin/wypakuj_logi echo -n 'starting early daemons:' $ cat /usr/sbin/wypakuj_logi #!/bin/ksh echo 'Populationg /var/log' cd / list_of_files=$(tar -ztf /var/sysmerge/etc.tgz | grep ^\./var/log) tar -zxvf /var/sysmerge/etc.tgz ${list_of_files} Code:
$ grep mfs /etc/fstab | grep 'var/log' swap /var/log mfs rw,-s=40960,nosuid,nodev 0 0
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase |
Tags |
/var, /var/log, log, logs, tmpfs |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
tmpfs on OpenBSD | tmpusr | OpenBSD General | 4 | 12th August 2016 08:42 PM |
OpenBSD tmpfs Enabled in -current | J65nko | News | 0 | 17th December 2013 02:38 PM |
Running system in tmpfs or with readonly root | ragnvaldf | OpenBSD General | 2 | 4th March 2012 08:32 PM |
DragonFly BSD Update on tmpfs and swapcache work (in master) | J65nko | News | 1 | 22nd February 2010 01:32 AM |
sys.tar.gz missing from 3rd CD in 4.5? | thirdm | OpenBSD Installation and Upgrading | 0 | 5th May 2009 03:25 PM |