xref: /openbsd-src/regress/usr.sbin/syslogd/args-sigterm.pl (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1# The client writes a message to Sys::Syslog native method.
2# The syslogd writes it into a file and through a pipe.
3# The syslogd passes it via UDP to the loghost.
4# The server receives the message on its UDP socket.
5# Find the message in client, file, pipe, syslogd, server log.
6# Check that a SIGTERM terminates the syslogd child process.
7
8use strict;
9use warnings;
10
11our %args = (
12    client => {
13	func => sub {
14	    my $self = shift;
15	    write_message($self, get_testlog());
16	    ${$self->{server}}->loggrep("syslogd: exiting", 8)
17		or die ref($self), " no 'syslogd: exiting' server log";
18	},
19    },
20    syslogd => {
21	ktrace => {
22	    qr/syslogd  PSIG  SIGTERM caught handler/ => 1,
23	    qr/syslogd  RET   execve 0/ => 1,
24	},
25	loggrep => qr/\[unpriv\] syslogd child about to exit/,
26    },
27    server => {
28	func => sub {
29	    my $self = shift;
30	    read_message($self, get_testgrep());
31	    ${$self->{syslogd}}->kill_syslogd('TERM');
32	    read_message($self, qr/syslogd: exiting/);
33	},
34	down => qr/syslogd: exiting on signal 15/,
35    },
36);
37
381;
39