File: basic

package info (click to toggle)
syslog-ng 4.8.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,572 kB
  • sloc: ansic: 177,639; python: 13,035; cpp: 11,611; makefile: 7,012; sh: 5,147; java: 3,651; xml: 3,344; yacc: 1,377; lex: 599; perl: 193; awk: 190; objc: 162
file content (35 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh -e

rm -f /tmp/input
rm -f /tmp/output.log

echo "Starting syslog-ng"
/usr/sbin/syslog-ng --no-caps --process-mode=background --cfgfile /$(pwd)/debian/tests/config.syslog --persist-file=/tmp/persist_file --pidfile=/tmp/syslog-ng.pid --control=/tmp/syslog-ng.control

sleep 2

PID=$(cat /tmp/syslog-ng.pid)

echo "Syslog-ng pid is $PID"

if [ ! -L /proc/$PID/exe ]
then
  echo "syslog-ng could not start"
  exit 1
fi

echo "Sending a log message"
logger -u /tmp/input almafa

sleep 1

kill $PID

grep -q almafa /tmp/output.log
if [ $? -eq 1 ]
then
  echo "Logged message could not found"
  exit 1
fi

echo "Sent message has been found in the log. Good"