Compare commits

..

No commits in common. "b6d1ae26671a85e6087c98ec8b630855fc52886a" and "c82c004de7e25e770039cba5d6a34c30dd548533" have entirely different histories.

19 changed files with 71 additions and 91 deletions

View File

@ -28,7 +28,7 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install tree tshark valgrind
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Configure
run: |
set -x

View File

@ -15,8 +15,8 @@ jobs:
coverity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: coverity-toolchain-cache
with:
path: cov-analysis-linux64
@ -53,7 +53,7 @@ jobs:
--form description="${PROJECT_NAME} $(git rev-parse HEAD)" \
https://scan.coverity.com/builds?project=${COVERITY_PROJ}
- name: Upload build.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: coverity-build.log
path: cov-int/build-log.txt

View File

@ -7,11 +7,38 @@ on:
jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v2
- name: Extract ChangeLog entry ...
# Hack to extract latest entry for body_path below
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- name: Create release ...
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: sysklogd ${{ github.ref }}
body_path: release.md
draft: false
prerelease: false
tarball:
name: Build and upload release tarball
needs: release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Installing dependencies ...
run: |
sudo apt-get -y update
@ -22,16 +49,14 @@ jobs:
./configure --prefix=/tmp --with-systemd=/tmp/lib/systemd/system
- name: Build release ...
run: |
make release
make release || (cat sysklogd-2.3.0/_build/sub/test/start.log; cat sysklogd-2.3.0/_build/sub/test/remote.log; false)
ls -lF ../
mkdir -p artifacts/
mv ../*.tar.* artifacts/
- name: Extract ChangeLog entry ...
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
- name: Upload release artifacts ...
uses: skx/github-action-publish-binaries@release-0.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: sysklogd ${{ github.ref_name }}
bodyFile: "release.md"
artifacts: "artifacts/*"
releaseId: ${{ needs.release.outputs.release_id }}
args: artifacts/*

View File

@ -4,24 +4,6 @@ Change Log
All relevant changes to the project are documented in this file.
[v2.5.0][] - 2023-04-30
-----------------------
### Changes
- Issue #59: initial port to NuttX, contributed by Xiaomi
- Issue #61: add support for `-c` and `-cc` to disable log compression.
A single `-c` disables compression for pipes, another `-c` (or `-cc`)
disables compression for all other log targets
- The default `syslog.conf` now logs debug messages again (disabled in
v2.4.0) due to problems (confusion) reported in the field
- Dropped not recommended `KillMode=process` from systemd unit file
### Fixes
- Issue #60: document how to set side-wide permissions on log files
- Issue #62: early log messages lost when running under systemd, found
by Wind River Systems, including initial fix
[v2.4.4][] - 2022-08-14
-----------------------
@ -543,9 +525,7 @@ and a replacement for `syslog.h` to enable new features in RFC5424.
- Several bugfixes and improvements, please refer to the .c files
[UNRELEASED]: https://github.com/troglobit/sysklogd/compare/v2.5.0...HEAD
[v2.5.0]: https://github.com/troglobit/sysklogd/compare/v2.4.4...v2.5.0
[v2.4.4]: https://github.com/troglobit/sysklogd/compare/v2.4.3...v2.4.4
[UNRELEASED]: https://github.com/troglobit/sysklogd/compare/v2.4.3...HEAD
[v2.4.3]: https://github.com/troglobit/sysklogd/compare/v2.4.2...v2.4.3
[v2.4.2]: https://github.com/troglobit/sysklogd/compare/v2.4.1...v2.4.2
[v2.4.1]: https://github.com/troglobit/sysklogd/compare/v2.4.0...v2.4.1

View File

@ -1,4 +1,4 @@
# Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
# Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View File

@ -1,4 +1,4 @@
# Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
# Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -25,7 +25,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
AC_INIT([sysklogd], [2.5.0], [https://github.com/troglobit/sysklogd/issues],,
AC_INIT([sysklogd], [2.4.4], [https://github.com/troglobit/sysklogd/issues],,
[https://github.com/troglobit/sysklogd])
AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])

View File

@ -1,6 +1,6 @@
/* Replacement in case utimensat(2) is missing
*
* Copyright (C) 2017-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (C) 2017-2021 Joachim Wiberg <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -21,20 +21,12 @@
#endif
#include <sys/time.h> /* lutimes(), utimes(), utimensat() */
#ifndef TIMESPEC_TO_TIMEVAL
#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
#endif
int
__utimensat(int dirfd, const char *pathname, const struct timespec ts[2], int flags)
{
int ret = -1;
struct timeval tv[2];
(void)flags;
if (dirfd != 0) {
errno = ENOTSUP;
return -1;

View File

@ -1,4 +1,4 @@
# Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
# Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
.\" -*- nroff -*-
.\" Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
.\" Copyright (c) 2018-2022 Joachim Wiberg <troglobit@gmail.com>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -25,7 +25,7 @@
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.Dd April 30, 2023
.Dd August 1, 2022
.Dt LOGGER 1
.Os sysklogd
.Sh NAME

View File

@ -38,7 +38,7 @@
.Nd log systems messages
.Sh SYNOPSIS
.Nm
.Op Fl ?468AcdFHKknsTtv
.Op Fl ?468AdFHKknsTtv
.Op Fl a Ar addr[/len][:port]
.Op Fl a Ar name[:port]
.Op Fl b Ar addr[:port]
@ -245,12 +245,6 @@ relies on this file being removed at system reboot. The default
location depends on the system and how
.Nm
was configured.
.It Fl c
Disable the compression of repeated instances of the same line into a
single line of the form
.Dq Li "last message repeated N times"
when the output is a pipe to another program. If specified twice,
disable this compression in all cases.
.It Fl d
Put
.Nm

View File

@ -1,4 +1,4 @@
# Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
# Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -33,7 +33,7 @@ if ENABLE_LOGGER
bin_PROGRAMS += logger
endif
AM_CFLAGS = -W -Wall -Wextra -std=c99 -gdwarf-4
AM_CFLAGS = -W -Wall -Wextra -std=c99
AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter -fno-strict-aliasing
AM_CPPFLAGS = -DSYSCONFDIR=\"@sysconfdir@\" -DRUNSTATEDIR=\"@runstatedir@\"
AM_CPPFLAGS += -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE

View File

@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 2018-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (C) 2017-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (C) 2017-2021 Joachim Wiberg <troglobit@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (C) 2017-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (C) 2017-2021 Joachim Wiberg <troglobit@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -144,7 +144,6 @@ static int MarkInterval = 20 * 60; /* interval between marks in seconds */
static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
static int mask_C1 = 1; /* mask characters from 0x80 - 0x9F */
static int send_to_all; /* send message to all IPv4/IPv6 addresses */
static int no_compress; /* don't compress messages (1=pipes, 2=all) */
static int secure_opt; /* sink for others, log to remote, or only unix domain socks */
static int secure_mode; /* same as above but from syslog.conf, only if cmdline unset */
@ -194,7 +193,6 @@ void untty(void);
static void parsemsg(const char *from, char *msg);
static int opensys(const char *file);
static void printsys(char *msg);
static void unix_cb(int sd, void *arg);
static void logmsg(struct buf_msg *buffer);
static void logrotate(struct filed *f);
static void rotate_file(struct filed *f, struct stat *stp_or_null);
@ -397,7 +395,7 @@ int main(int argc, char *argv[])
char *ptr;
int ch;
while ((ch = getopt(argc, argv, "468Aa:b:C:cdHFf:Kkm:nP:p:r:sTtv?")) != EOF) {
while ((ch = getopt(argc, argv, "468Aa:b:C:dHFf:Kkm:nP:p:r:sTtv?")) != EOF) {
switch ((char)ch) {
case '4':
family = PF_INET;
@ -435,10 +433,6 @@ int main(int argc, char *argv[])
CacheFile = optarg;
break;
case 'c':
no_compress++;
break;
case 'd': /* debug */
Debug = 1;
Foreground = 1;
@ -527,20 +521,12 @@ int main(int argc, char *argv[])
.pe_serv = "syslog",
});
/* Figure out where to read system log messages from */
if (!pflag) {
/* Do we run under systemd-journald (Requires=syslog.socket)? */
if (fcntl(3, F_GETFD) != -1) {
if (socket_register(3, NULL, unix_cb, NULL) == -1)
err(1, "failed registering syslog.socket (3)");
} else {
/* Default to _PATH_LOG for the UNIX domain socket */
addpeer(&(struct peer) {
.pe_name = _PATH_LOG,
.pe_mode = 0666,
});
}
}
/* Default to _PATH_LOG for the UNIX domain socket */
if (!pflag)
addpeer(&(struct peer) {
.pe_name = _PATH_LOG,
.pe_mode = 0666,
});
if (!Foreground && !Debug) {
ppid = waitdaemon(30);
@ -1685,8 +1671,7 @@ static void logmsg(struct buf_msg *buffer)
/*
* suppress duplicate lines to this file
*/
if (no_compress - (f->f_type != F_PIPE) < 1 &&
(buffer->flags & MARK) == 0 && savedlen == f->f_prevlen &&
if ((buffer->flags & MARK) == 0 && savedlen == f->f_prevlen &&
!strcmp(saved, f->f_prevline)) {
f->f_lasttime = buffer->timestamp;
f->f_prevcount++;

View File

@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (C) 2017-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (C) 2017-2021 Joachim Wiberg <troglobit@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -106,7 +106,7 @@ static int __timer_start(void)
if (sec <= 0)
sec = 1;
return alarm((unsigned int)sec);
return alarm(sec);
}
/*

View File

@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (C) 2017-2023 Joachim Wiberg <troglobit@gmail.com>
* Copyright (C) 2017-2021 Joachim Wiberg <troglobit@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -7,7 +7,11 @@
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
# Everything except debug and security tokens, re-enable debug by
# dropping '*.!=debug;', or enable /var/log/debug below
*.*;*.!=debug;\
auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
#daemon.* -/var/log/daemon.log

View File

@ -6,7 +6,7 @@ Requires=syslog.socket
[Service]
EnvironmentFile=-@SYSCONFDIR@/default/syslogd
ExecStart=@SBINDIR@/syslogd -F $SYSLOGD_OPTS
ExecStart=@SBINDIR@/syslogd -F -p /run/systemd/journal/syslog $SYSLOGD_OPTS
StandardOutput=null
Restart=on-failure