I love xz compression. It really pinches the bytes outa ascii files, which log
files
are of course made of.
Is there a direction someone can point me in that would permit the
functionality this
diff provides without hardcoding it and perhaps be acceptable for the tree?
diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile
index 1bb0ce36439..03787a6439b 100644
--- a/usr.bin/newsyslog/Makefile
+++ b/usr.bin/newsyslog/Makefile
@@ -6,4 +6,8 @@ BINOWN= root
MAN= newsyslog.8
+CFLAGS += -DCOMPRESS='"/usr/local/bin/xz"'
+CFLAGS += -DCOMPRESS_FORCE='"-f9e"'
+CFLAGS += -DCOMPRESS_POSTFIX='".xz"'
+
.include <bsd.prog.mk>
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index 066167151ca..7d3a959ad90 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -73,8 +73,15 @@
#define CONF "/etc/newsyslog.conf"
#define PIDFILE "/var/run/syslog.pid"
+#ifndef COMPRESS
#define COMPRESS "/usr/bin/gzip"
+#endif
+#ifndef COMPRESS_FORCE
+#define COMPRESS_FORCE "-f"
+#endif
+#ifndef COMPRESS_POSTFIX
#define COMPRESS_POSTFIX ".gz"
+#endif
#define STATS_DIR "/var/run"
#define SENDMAIL "/usr/sbin/sendmail"
@@ -925,7 +932,7 @@ compress_log(struct conf_entry *ent)
if (pid == -1) {
err(1, "fork");
} else if (pid == 0) {
- (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL);
+ (void)execl(COMPRESS, base, COMPRESS_FORCE, tmp, (char *)NULL);
warn(COMPRESS);
_exit(1);
}
--
Todd Fries .. [email protected]
____________________________________________
| \ 1.636.410.0632 (voice)
| Free Daemon Consulting, LLC \ 1.405.227.9094 (voice)
| http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX)
| PO Box 16169, Oklahoma City, OK 73113-2169 \ sip:[email protected]
| "..in support of free software solutions." \ sip:[email protected]
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A
http://todd.fries.net/pgp.txt