> -----Original Message----- > From: Peng Haitao [mailto:[email protected]] > Sent: Monday, January 16, 2012 6:33 AM > To: Rainer Gerhards > Cc: rsyslog-users > Subject: Re: [rsyslog] [PATCH] fix error of not define HAVE_SETSID > > > Peng Haitao said the following on 2012-1-6 14:48: > > [add list to the CC list] > > > > When HAVE_SETSID is not defined, rsyslogd will use ioctl() make itself > > to daemon, but this can not make rsyslogd process become the process > > group leader of a new process group. In RHEL6.1, the status is as follows: > > # uname -a > > Linux RHEL6U1GA-Intel64-199 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May > > 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux # /etc/init.d/rsyslog > restart > > Shutting down system logger: [ OK ] > > Starting system logger: [ OK ] > > # ps axo pgrp,ppid,pid,comm | grep rsyslog > > 6290 1 6301 rsyslogd > > > > When we send SIGTERM signal to 6290, rsyslogd will die:( So I think we > > should call setpgid() before ioctl(). > > > > hi, anyone can comment the patch?
Sorry, I am still busy, it's on my todo list and looks good on first impression. Bear with me a little bit more, I hope to be able to go back to real work soon... ;) Rainer > > -- > Best Regards, > Peng > > > Signed-off-by: Peng Haitao <[email protected]> > > --- > > tools/syslogd.c | 7 +++++++ > > 1 files changed, 7 insertions(+), 0 deletions(-) > > > > diff --git a/tools/syslogd.c b/tools/syslogd.c index d1224f2..ac954b7 > > 100644 > > --- a/tools/syslogd.c > > +++ b/tools/syslogd.c > > @@ -356,8 +356,15 @@ void untty(void) > > #else > > { > > int i; > > + pid_t pid; > > > > if(!Debug) { > > + pid = getpid(); > > + if (setpgid(pid, pid) < 0) { > > + perror("setpgid"); > > + exit(1); > > + } > > + > > i = open(_PATH_TTY, O_RDWR|O_CLOEXEC); > > if (i >= 0) { > > # if !defined(__hpux) > _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/

