From c91b79de4689c75eb2f33a3b16181fed22c87292 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Tue, 16 Feb 2021 04:05:02 -0300 Subject: [PATCH] Replace socklog with sysklogd, logrotate alternatives MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Back in time, the first Dragora series included sysklogd and logrotate. Later it was replaced by Runit; already in Dragora 3 the same scheme for sysklogd and logrotate was tried to be followed but in communication with Wayne Marshall[1] the course was changed. This is also partly because sysklogd was not being maintained for some time and a reliable alternative was sought, but now sysklogd is being maintained, improved. It also includes the klog functionality inside, so it is no longer necessary to have "klogd" as a separate service running. [1] https://lists.nongnu.org/archive/html/dragora-users/2017-05/msg00028.html Signed-off-by: Matías Fonzo --- archive/socklog/klog/rc.log | 10 --- archive/socklog/klog/rc.main | 31 ------- archive/socklog/rc.log | 10 --- archive/socklog/rc.main | 37 -------- archive/socklog/socklog-config.tar.gz | Bin 720 -> 0 bytes archive/socklog/socklog-config.tar.gz.txt | 32 ------- patches/socklog/socklog-headers | 54 ----------- patches/socklog/socklog-klogpath | 11 --- recipes/00-core.order | 7 +- recipes/daemons/socklog/recipe | 143 ------------------------------ sources/SOURCELIST.txt | 1 - sources/socklog-2.1.0.tar.gz.sha256 | 1 - 12 files changed, 4 insertions(+), 333 deletions(-) delete mode 100644 archive/socklog/klog/rc.log delete mode 100644 archive/socklog/klog/rc.main delete mode 100644 archive/socklog/rc.log delete mode 100644 archive/socklog/rc.main delete mode 100644 archive/socklog/socklog-config.tar.gz delete mode 100644 archive/socklog/socklog-config.tar.gz.txt delete mode 100644 patches/socklog/socklog-headers delete mode 100644 patches/socklog/socklog-klogpath delete mode 100644 recipes/daemons/socklog/recipe delete mode 100644 sources/socklog-2.1.0.tar.gz.sha256 diff --git a/archive/socklog/klog/rc.log b/archive/socklog/klog/rc.log deleted file mode 100644 index 68bb29a4..00000000 --- a/archive/socklog/klog/rc.log +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -# -# perpetrate(5) runscript for klog. -# - -if test "$1" = start -then - exec tinylog -k 5 -t /var/log/${2} -fi - diff --git a/archive/socklog/klog/rc.main b/archive/socklog/klog/rc.main deleted file mode 100644 index dde55eb5..00000000 --- a/archive/socklog/klog/rc.main +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -# -# klog/rc.main -# -# Simple kernel log "daemon" -# - -# Redirects the standard error to the standard output -exec 2>&1 - -TARGET="$1" -SVNAME="${2:-klog}" - -start() -{ - echo "*** ${SVNAME}: Starting klog ..." - while IFS= read -r line - do - echo "$line" - done < /proc/kmsg -} - -reset() -{ - echo "*** ${SVNAME}: Resetting" - exit 0 -} - -# Branch to target -eval ${TARGET} "$@" - diff --git a/archive/socklog/rc.log b/archive/socklog/rc.log deleted file mode 100644 index 0f5537d7..00000000 --- a/archive/socklog/rc.log +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -# -# Generic perpetrate(5) runscript for socklog. -# - -if test "$1" = start -then - exec tinylog_run "$2" -fi - diff --git a/archive/socklog/rc.main b/archive/socklog/rc.main deleted file mode 100644 index 8f5b19f5..00000000 --- a/archive/socklog/rc.main +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/sh - -# -# socklog/rc.main -# -# Unix domain datagram socket for listening on /dev/log -# - -# Redirects the standard error to the standard output -exec 2>&1 - -TARGET="$1" -SVNAME="${2:-socklog}" - -start() -{ - echo "*** ${SVNAME}: Starting socklog ..." - exec /usr/sbin/socklog unix /dev/log -} - -reset() -{ - case $3 in - exit) - echo "*** ${SVNAME}: Exited status $4" - ;; - signal) - echo "*** ${SVNAME}: Killed on signal $5" - ;; - *) - echo "*** ${SVNAME}: Stopped (${3})" - ;; - esac -} - -# Branch to target -eval ${TARGET} "$@" - diff --git a/archive/socklog/socklog-config.tar.gz b/archive/socklog/socklog-config.tar.gz deleted file mode 100644 index 03c555f6dc0a7641658c0ad3937213abb028db5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 720 zcwS|XYe-XZ9EMMG)^wDa)*z*fWM*FGjUt6kuypkyx)E(z9m;Cx%+2f~k^Bw2P{JGw zTC!?r(NHv#G8A#gh*DEIkkHC$n@-)F=2lzGGtW7{_PzJ>`|v*R)_Q?JoFrE8BC6CS zs&ch5qeNYCsZ^PH_1qQg*VD<0>8$ldRino>lP5knP4b$j@w|kM`khg|9-DRDyR^ut z=u^sxP{Hm}p(w*17)jQ?m0utAT(p)O6j^sZZq81OY;hiarj_L!+y8QCr?fFCb<*Y% z8*8OjQTxh?37O`1jrA-nOZRH+cRne(PfgHwfg+AA{W+-@(77{YndeZ~S{-`*_lGRd zXnFjC>FUZi)~EW_##dy(qUu0nOt1O2;_{`2n74#Qu*vLH6|~=MkfR_7|H=nf+RMcB_*x-_h{t96%mj-L*>GwEwdf%oj!QU zrL3Ay`32YLTi=UvAx#KXGgJO0`wbp@VXm8Z;?61O0>X zQs96g)?1GmkUjv-6`?Z!ra|aQqzSih0lw^L9Q8k8h_)bZgUMo%dzY>tM0U!-HH7!` zH3PKCiiIG+f}H;Z+pq{L&EtjdxVpbc%e>eF!;xWmMDX7rJx7RUEiJSQrZ__C!w++d zev+~uu)|b%9i{WG*78}xfO@OHq2wi)9>n#uU7+{jbx;%A&m9b*F>>{I#LfG_KF(T3 zf0#Nq2)W(P1-wTU<%0lsqYz`w^B_I>K6Vtk!LS{|M;BqvM@o2kwaF}5X537{0V_zk z*kuSXF(Z)31q(4SyJ4U;b49>-(GnxcV<;Wc-Nz=Llj6H9UQUB|o8uK5raqr%mD5}U z3lD;ziCNV*1V7^};N&D)hF$?3DLxIe!=^5Xp?kwE+zr@&v5XW{9$8wzsxj;z>|LL= diff --git a/archive/socklog/socklog-config.tar.gz.txt b/archive/socklog/socklog-config.tar.gz.txt deleted file mode 100644 index 01302f50..00000000 --- a/archive/socklog/socklog-config.tar.gz.txt +++ /dev/null @@ -1,32 +0,0 @@ -drwxr-x--- log/log 0 2017-05-24 21:01 ./socklog/ -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/auth/ --rw-r--r-- root/root 34 2017-05-24 21:00 ./socklog/auth/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/local/ --rw-r--r-- root/root 23 2017-05-24 21:00 ./socklog/local/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/main/ --rw-r--r-- root/root 12 2017-05-24 21:00 ./socklog/main/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/debug/ --rw-r--r-- root/root 24 2017-05-24 21:00 ./socklog/debug/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/kern/ --rw-r--r-- root/root 22 2017-05-24 21:00 ./socklog/kern/config -prw--w---- log/adm 0 2017-05-24 21:01 ./socklog/.notify -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/syslog/ --rw-r--r-- root/root 24 2017-05-24 21:00 ./socklog/syslog/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/mail/ --rw-r--r-- root/root 22 2017-05-24 21:00 ./socklog/mail/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/daemon/ --rw-r--r-- root/root 24 2017-05-24 21:00 ./socklog/daemon/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/news/ --rw-r--r-- root/root 22 2017-05-24 21:00 ./socklog/news/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/ftp/ --rw-r--r-- root/root 21 2017-05-24 21:00 ./socklog/ftp/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/user/ --rw-r--r-- root/root 22 2017-05-24 21:00 ./socklog/user/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog/cron/ --rw-r--r-- root/root 22 2017-05-24 21:00 ./socklog/cron/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog-inet/ -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog-inet/main/ --rw-r--r-- root/root 12 2017-05-24 21:00 ./socklog-inet/main/config -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog-klog/ -drwxr-x--- log/log 0 2017-05-24 21:00 ./socklog-klog/main/ --rw-r--r-- root/root 12 2017-05-24 21:00 ./socklog-klog/main/config diff --git a/patches/socklog/socklog-headers b/patches/socklog/socklog-headers deleted file mode 100644 index b7c10e3d..00000000 --- a/patches/socklog/socklog-headers +++ /dev/null @@ -1,54 +0,0 @@ -add missing headers for misc funcs and types - ---- a/chkshsgr.c -+++ b/chkshsgr.c -@@ -1,10 +1,11 @@ - /* Public domain. */ - - #include -+#include - - int main() - { -- short x[4]; -+ gid_t x[4]; - - x[0] = x[1] = 0; - if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1); ---- a/pathexec_run.c -+++ b/pathexec_run.c -@@ -1,5 +1,6 @@ - /* Public domain. */ - -+#include - #include "error.h" - #include "stralloc.h" - #include "str.h" ---- a/prot.c -+++ b/prot.c -@@ -1,12 +1,15 @@ - /* Public domain. */ - -+#include -+#include -+ - #include "hasshsgr.h" - #include "prot.h" - - int prot_gid(int gid) - { - #ifdef HASSHORTSETGROUPS -- short x[2]; -+ gid_t x[2]; - x[0] = gid; x[1] = 73; /* catch errors */ - if (setgroups(1,x) == -1) return -1; - #else ---- a/seek_set.c -+++ b/seek_set.c -@@ -1,5 +1,6 @@ - /* Public domain. */ - -+#include - #include - #include "seek.h" - diff --git a/patches/socklog/socklog-klogpath b/patches/socklog/socklog-klogpath deleted file mode 100644 index 0eec40fa..00000000 --- a/patches/socklog/socklog-klogpath +++ /dev/null @@ -1,11 +0,0 @@ ---- src/socklog-conf.c.orig 2006-03-06 10:00:06.000000000 -0300 -+++ src/socklog-conf.c 2017-05-24 09:14:31.000000000 -0300 -@@ -19,7 +19,7 @@ - #include - #endif - #ifndef _PATH_KLOG --#define _PATH_KLOG "/dev/klog" -+#define _PATH_KLOG "/dev/kmsg" - #endif - - #define USAGE1 " unix|inet|klog|ucspi acct logacct [/etc/sv] [/logdir]" diff --git a/recipes/00-core.order b/recipes/00-core.order index 4d093206..32394563 100644 --- a/recipes/00-core.order +++ b/recipes/00-core.order @@ -237,11 +237,12 @@ tools/jfsutils: tools/util-linux tools/xfsprogs: libs/readline tools/util-linux tools/gettext-tiny tools/reiser4progs: libs/libaal -# System initialization +# System initialization and related boot/sysvinit: boot/bootscripts -daemons/scron: boot/perp -daemons/socklog: boot/perp boot/perp: +daemons/scron: +tools/logrotate: +daemons/sysklogd: boot/grub: boot/os-prober tools/mdadm tools/lvm2 tools/dosfstools libs/fuse2 # RPC support diff --git a/recipes/daemons/socklog/recipe b/recipes/daemons/socklog/recipe deleted file mode 100644 index 01fa3e3a..00000000 --- a/recipes/daemons/socklog/recipe +++ /dev/null @@ -1,143 +0,0 @@ -# Build recipe for socklog. -# -# Copyright (c) 2017 Matias Fonzo, . -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Exit immediately on any error -set -e - -program=socklog -version=2.1.0 -release=1 - -# Define a category for the output of the package name -pkgcategory=daemons - -tarname=${program}-${version}.tar.gz - -# Remote source(s) -fetch=https://smarden.org/socklog/$tarname - -description=" -System and kernel logging services. - -Socklog is a small and secure replacement for syslogd. Socklog -supports system logging through Unix domain sockets (/dev/log), -UDP sockets (0.0.0.0:514), as well as TCP socket. - -Socklog provides a different network logging concept, and also -does log event notification. - -Socklog is small, secure, and reliable. -" - -homepage=https://smarden.org/socklog -license=BSD - -# Source documentation -docs="CHANGES COPYING README" -docsdir="${docdir}/${program}-${version}" - -# Source directory used by this software -srcdir=admin/${program}-${version} - -build() -{ - unpack "${tardir}/$tarname" - - cd "$srcdir" - - # Set sane permissions - chmod -R u+w,go-w,a+rX-s . - - cd src - patch -p1 < "${worktree}/patches/socklog/socklog-headers" - patch -p1 < "${worktree}/patches/socklog/socklog-klogpath" - cd - - - # Pick up our custom CFLAGS, LDFLAGS - sed -i "s|gcc -O2|cc $QICFLAGS|" src/conf-cc - sed -i "s|gcc -s|cc $QILDFLAGS -static|" src/conf-ld - - ./package/compile - - # Prepare the package, manually - - mkdir -p "${destdir}/usr/bin" "${destdir}/usr/sbin" \ - "${destdir}/${mandir}/man1" "${destdir}/${mandir}/man8" - - cp -p command/tryto command/uncat \ - "${destdir}/usr/bin" - - cp -p command/socklog-check command/socklog-conf command/socklog \ - "${destdir}/usr/sbin" - - cp -p man/*.1 "${destdir}/${mandir}/man1/" - cp -p man/*.8 "${destdir}/${mandir}/man8/" - - # This is specific and related to the runit project - rm -f "${destdir}/usr/sbin/socklog-conf" \ - "${destdir}/${mandir}/man8/socklog-conf.8" - - # Install socklog perp service(s) - - mkdir -p "${destdir}/etc/perp/socklog" "${destdir}/etc/perp/klog" - - cp -p "${worktree}/archive/socklog/rc.log" \ - "${worktree}/archive/socklog/rc.main" \ - "${destdir}/etc/perp/socklog/" - - cp -p "${worktree}/archive/socklog/klog/rc.log" \ - "${worktree}/archive/socklog/klog/rc.main" \ - "${destdir}/etc/perp/klog/" - - chmod 755 "${destdir}"/etc/perp/socklog/rc.* \ - "${destdir}"/etc/perp/klog/rc.* - - # Be an active service by default - chmod +t "${destdir}/etc/perp/socklog" \ - "${destdir}/etc/perp/klog" - - # Include pre-configuration file for /var/log - mkdir -p "${destdir}/var/log" - ( - cd "${destdir}/var/log" - umask 000 - tar xf "${worktree}/archive/socklog/socklog-config.tar.gz" - ) - - # To handle config file(s) - touch "${destdir}/etc/perp/socklog/.graft-config" \ - "${destdir}/etc/perp/klog/.graft-config" - - ( - cd "${destdir}/var/log" - find . -type f | while read -r file - do - touch "$(dirname -- "$file")/.graft-config" - done - ) - - # Compress and copy documentation - - lzip -9 "${destdir}/${mandir}"/man?/* - - mkdir -p "${destdir}${docsdir}" - - for file in $docs - do - cp -p package/${file} "${destdir}${docsdir}" - done -} - diff --git a/sources/SOURCELIST.txt b/sources/SOURCELIST.txt index 3dc9f31a..ac63fa9d 100644 --- a/sources/SOURCELIST.txt +++ b/sources/SOURCELIST.txt @@ -300,7 +300,6 @@ https://rubygems.org/downloads/asciidoctor-2.0.12.gem https://savannah.c3sl.ufpr.br/libpipeline/libpipeline-1.5.3.tar.gz https://sethwklein.net/iana-etc-2.30.tar.bz2 https://smarden.org/runit/runit-2.1.2.tar.gz -https://smarden.org/socklog/socklog-2.1.0.tar.gz https://software.calhariz.com/at/at_3.2.1.orig.tar.gz https://sourceforge.net/projects/lcms/files/lcms/2.11/lcms2-2.11.tar.gz https://sourceforge.net/projects/libtirpc/files/libtirpc/1.3.1/libtirpc-1.3.1.tar.bz2 diff --git a/sources/socklog-2.1.0.tar.gz.sha256 b/sources/socklog-2.1.0.tar.gz.sha256 deleted file mode 100644 index 739be2f9..00000000 --- a/sources/socklog-2.1.0.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -aa869a787ee004da4e5509b5a0031bcc17a4ab4ac650c2ce8d4e488123acb455 socklog-2.1.0.tar.gz -- 2.11.4.GIT