Re: Append system start up messages to new /var/log/dmesg in /etc/rc

2016-11-04 Thread Craig Skinner
Resend folks:

On 2016-10-19 Wed 14:19 PM |, Craig Skinner wrote:
> Hi,
> 
> With dmesg's new -s flag, append each boot's full log to a new
> /var/log/dmesg semi-private log file.
> 
> Inspired by Alexander Hall's recent post:
> http://marc.info/?l=openbsd-misc&m=147674181621645
> 
> This works for me (on 5.9) & rotates correctly:
> 
> 
> 
> Index: rc
> ===
> RCS file: /cvs/src/etc/rc,v
> retrieving revision 1.486
> diff -u -p -r1.486 rc
> --- rc10 Jul 2016 09:08:18 -  1.486
> +++ rc19 Oct 2016 13:04:04 -
> @@ -563,4 +563,7 @@ start_daemon apmd sensorsd hotplugd watc
>  echo '.'
>  
>  date
> -exit 0
> +umask 027
> +dmesg >>/var/log/dmesg
> +dmesg -s >>/var/log/dmesg
> +umask 022
> Index: newsyslog.conf
> ===
> RCS file: /cvs/src/etc/newsyslog.conf,v
> retrieving revision 1.35
> diff -u -p -r1.35 newsyslog.conf
> --- newsyslog.conf1 Jun 2016 16:57:07 -   1.35
> +++ newsyslog.conf19 Oct 2016 13:04:04 -
> @@ -10,6 +10,7 @@
>  /var/log/lpd-errs640  7 10   * Z
>  /var/log/maillog 640  7 *24Z
>  /var/log/messages644  5 300  * Z
> +/var/log/dmesg   640  3 100  * Z
>  /var/log/secure  600  7 *168   Z
>  /var/log/wtmp644  7 *$W6D4 B
>  /var/log/xferlog 640  7 250  * Z
> 

-- 
Craig Skinner | http://linkd.in/yGqkv7



Re: Append system start up messages to new /var/log/dmesg in /etc/rc

2016-10-19 Thread Landry Breuil
On Wed, Oct 19, 2016 at 02:19:22PM +0100, Craig Skinner wrote:
> Hi,
> 
> With dmesg's new -s flag, append each boot's full log to a new
> /var/log/dmesg semi-private log file.
> 
> Inspired by Alexander Hall's recent post:
> http://marc.info/?l=openbsd-misc&m=147674181621645
> 
> This works for me (on 5.9) & rotates correctly:

Note that dmesg is already saved in var/run/dmesg.boot but not dmesg
-s.

Landry



Append system start up messages to new /var/log/dmesg in /etc/rc

2016-10-19 Thread Craig Skinner
Hi,

With dmesg's new -s flag, append each boot's full log to a new
/var/log/dmesg semi-private log file.

Inspired by Alexander Hall's recent post:
http://marc.info/?l=openbsd-misc&m=147674181621645

This works for me (on 5.9) & rotates correctly:



Index: rc
===
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.486
diff -u -p -r1.486 rc
--- rc  10 Jul 2016 09:08:18 -  1.486
+++ rc  19 Oct 2016 13:04:04 -
@@ -563,4 +563,7 @@ start_daemon apmd sensorsd hotplugd watc
 echo '.'
 
 date
-exit 0
+umask 027
+dmesg >>/var/log/dmesg
+dmesg -s >>/var/log/dmesg
+umask 022
Index: newsyslog.conf
===
RCS file: /cvs/src/etc/newsyslog.conf,v
retrieving revision 1.35
diff -u -p -r1.35 newsyslog.conf
--- newsyslog.conf  1 Jun 2016 16:57:07 -   1.35
+++ newsyslog.conf  19 Oct 2016 13:04:04 -
@@ -10,6 +10,7 @@
 /var/log/lpd-errs  640  7 10   * Z
 /var/log/maillog   640  7 *24Z
 /var/log/messages  644  5 300  * Z
+/var/log/dmesg 640  3 100  * Z
 /var/log/secure600  7 *168   Z
 /var/log/wtmp  644  7 *$W6D4 B
 /var/log/xferlog   640  7 250  * Z