1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

When running interactive we want to set our own process group for

signal management.
Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent 54cbfc7ebc
commit fffae94dd5
6 changed files with 34 additions and 4 deletions

4
source/configure vendored
View File

@ -945,7 +945,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
for ac_prog in mawk gawk nawk awk
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@ -5191,7 +5191,7 @@ else
fi
done
for ac_func in fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat
for ac_func in fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5198: checking for $ac_func" >&5

View File

@ -554,7 +554,7 @@ else
fi
AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown fchown chmod fchmod chroot)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)

View File

@ -1,4 +1,4 @@
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
@ -695,6 +695,9 @@
/* Define if you have the setnetgrent function. */
#undef HAVE_SETNETGRENT
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
/* Define if you have the setpriv function. */
#undef HAVE_SETPRIV

View File

@ -803,6 +803,15 @@ static void usage(char *pname)
become_daemon();
}
#if HAVE_SETPGID
/*
* If we're interactive we want to set our own process group for
* signal management.
*/
if (opt_interactive)
setpgid( (pid_t)0, (pid_t)0 );
#endif
#ifndef SYNC_DNS
/* Setup the async dns. We do it here so it doesn't have all the other
stuff initialised and thus chewing memory and sockets */

View File

@ -822,6 +822,15 @@ int main(int argc, char **argv)
if (!interactive)
become_daemon();
#if HAVE_SETPGID
/*
* If we're interactive we want to set our own process group for
* signal management.
*/
if (interactive)
setpgid( (pid_t)0, (pid_t)0);
#endif
load_interfaces();
secrets_init();

View File

@ -785,6 +785,15 @@ static void usage(char *pname)
become_daemon();
}
#if HAVE_SETPGID
/*
* If we're interactive we want to set our own process group for
* signal management.
*/
if (interactive)
setpgid( (pid_t)0, (pid_t)0);
#endif
if (!directory_exist(lp_lockdir(), NULL)) {
mkdir(lp_lockdir(), 0755);
}