-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syslog-ng 3.6 may kill init process #586
Comments
seems to be caused by this patch: probably the getpgid() call fails, returns -1 which in turn means to kill the process group of the entire init process. It must have been difficult to diagnose, thanks for the effort and the report. |
hmm.. I think you are right. |
Fixes: syslog-ng#586 Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>
@mcmurphy75 : #590 should solve the problem |
@mcmurphy75 The fix for this issue has been merged (#590). Could you close this issue? |
Unfortunately I have no development system to test the fix in my environment, but unchecked getpgid really looks like a cause of the problem. Good work. Thanks. |
Fixes: syslog-ng#586 Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>
If a destination program exits right before syslog-ng wants to terminate it, syslog-ng terminates init process instead of the program. If init process is immutable to TERM signal, on Ubuntu for example, it is not a problem. But otherwise you are in trouble, system goes down.
Tested on FreeBSD 8.4-p19 and FreeBSD 8.4-p34.
Syslog-ng 3.6.2 and 3.6.4 installed from freebsd package repository.
Hardware: HP Proliant DL380G5
CPU: Intel(R) Xeon(R) CPU E5440 @ 2.83GHz (2833.35-MHz K8-class CPU)
Origin = "GenuineIntel" Id = 0x10676 Family = 6 Model = 17 Stepping = 6
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0xce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1>
AMD Features=0x20100800<SYSCALL,NX,LM>
AMD Features2=0x1
TSC: P-state invariant
real memory = 4294967296 (4096 MB)
avail memory = 4097650688 (3907 MB)
ACPI APIC Table:
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP): APIC ID: 3
root@freebsd:~# uname -a
FreeBSD freebsd.local 8.4-RELEASE-p19 FreeBSD 8.4-RELEASE-p19 #0: Mon Nov 3 17:12:38 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Configuration 1:
=== BEGIN =====
@Version: 3.6
@include "scl.conf"
source s_local { system(); internal(); };
destination d_local { program("not-existent-path"); }; # Trigger on stop, restart or reload
destination d_local1 { program("/usr/bin/true"); }; # Trigger on stop, restart or reload
log { source(s_local); destination(d_local); };
=== END ===
root@freebsd:
# /usr/local/etc/rc.d/syslog-ng start# /usr/local/etc/rc.d/syslog-ng reload # or restart, or stopStarting syslog_ng.
root@freebsd:
root@freebsd:~# Writing entropy file:.
Terminated
.
Enter full pathname of shell or RETURN for /bin/sh:
It may need a few syslog-ng reloads to trigger the issue.
Same effect is on restart and stop.
Configuration 2:
=== BEGIN =====
@Version: 3.6
@include "scl.conf"
source s_local { system(); internal(); };
destination d_local { program("/bin/cat"); }; # Trigger on "killall -1 cat syslog-ng"
log { source(s_local); destination(d_local); };
=== END ===
root@freebsd:
# /usr/local/etc/rc.d/syslog-ng start# killall -1 cat syslog-ngStarting syslog_ng.
root@freebsd:
root@freebsd:~# Writing entropy file:.
Terminated
.
Enter full pathname of shell or RETURN for /bin/sh:
It seems no problem with source programs.
It seems no problem with syslog-ng 3.5.
Other syslog-ng releases was not tested.
The text was updated successfully, but these errors were encountered: