nss-pam-ldapd branch master updated. 0.9.0-39-gcda6dcd
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd branch master updated. 0.9.0-39-gcda6dcd
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd branch master updated. 0.9.0-39-gcda6dcd
- Date: Sun, 18 Aug 2013 12:14:07 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".
The branch, master has been updated
via cda6dcdc9722eb551f8698b8711ad2eae2d02ac6 (commit)
via 1825be6809139b791d3194d21a6d640dea81a994 (commit)
via 82bcfd7a4d38cd61444f871469c25c25e973798c (commit)
via 14b93b9ebbe6a16c9ffe7be5491f56fa0c564f85 (commit)
from 8a3f0f51b2406e6ee9537fdc96cadc0d3fa2194c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=cda6dcdc9722eb551f8698b8711ad2eae2d02ac6
commit cda6dcdc9722eb551f8698b8711ad2eae2d02ac6
Merge: 8a3f0f5 1825be6
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Aug 18 12:10:54 2013 +0200
Implement an option to run in the foreground
This introduces a -n, --nofork option that skips the deamonising step on
start-up. This may be required for running nslcd from upstart.
See:
https://bugs.launchpad.net/bugs/806761
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=1825be6809139b791d3194d21a6d640dea81a994
commit 1825be6809139b791d3194d21a6d640dea81a994
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Aug 18 12:00:19 2013 +0200
Document -n, --nofork option
diff --git a/man/nslcd.8.xml b/man/nslcd.8.xml
index da8d9f1..9b7ff90 100644
--- a/man/nslcd.8.xml
+++ b/man/nslcd.8.xml
@@ -104,6 +104,18 @@
</listitem>
</varlistentry>
+ <varlistentry id="nofork">
+ <term>
+ <option>-n</option>, <option>--nofork</option>
+ </term>
+ <listitem>
+ <para>
+ Do not fork or daemonise and run <command>nslcd</command> in the
+ foreground.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="help">
<term>
<option>--help</option>
diff --git a/man/pynslcd.8.xml b/man/pynslcd.8.xml
index a146ecd..217db2e 100644
--- a/man/pynslcd.8.xml
+++ b/man/pynslcd.8.xml
@@ -103,6 +103,18 @@
</listitem>
</varlistentry>
+ <varlistentry id="nofork">
+ <term>
+ <option>-n</option>, <option>--nofork</option>
+ </term>
+ <listitem>
+ <para>
+ Do not fork or daemonise and run <command>pynslcd</command> in the
+ foreground.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="help">
<term>
<option>--help</option>
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=82bcfd7a4d38cd61444f871469c25c25e973798c
commit 82bcfd7a4d38cd61444f871469c25c25e973798c
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Aug 18 11:54:16 2013 +0200
-n switch for pynslcd
diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py
index cd3a171..73fc3cc 100755
--- a/pynslcd/pynslcd.py
+++ b/pynslcd/pynslcd.py
@@ -45,6 +45,9 @@ program_name = 'pynslcd'
# flag to indicate whether we are in debugging mode
debugging = 0
+# flag to indicate we shouldn't daemonize
+nofork = False
+
# flag to indicate user requested the --check option
checkonly = False
@@ -99,6 +102,7 @@ def display_usage(fp):
"Name Service LDAP connection daemon.\n"
" -c, --check check if the daemon already is running\n"
" -d, --debug don't fork and print debugging to stderr\n"
+ " -n, --nofork don't fork\n"
" --help display this help and exit\n"
" --version output version information and exit\n"
"\n"
@@ -114,8 +118,8 @@ def parse_cmdline():
program_name = sys.argv[0] or program_name
try:
optlist, args = getopt.gnu_getopt(
- sys.argv[1:], 'cdhV',
- ('check', 'debug', 'help', 'version'))
+ sys.argv[1:], 'cdnhV',
+ ('check', 'debug', 'nofork', 'help', 'version'))
for flag, arg in optlist:
if flag in ('-c', '--check'):
global checkonly
@@ -123,6 +127,9 @@ def parse_cmdline():
elif flag in ('-d', '--debug'):
global debugging
debugging += 1
+ elif flag in ('-n', '--nofork'):
+ global nofork
+ nofork = True
elif flag in ('-h', '--help'):
display_usage(sys.stdout)
sys.exit(0)
@@ -297,7 +304,7 @@ if __name__ == '__main__':
constants.NSLCD_PIDFILE)
sys.exit(1)
# daemonize
- if debugging:
+ if debugging or nofork:
ctx = pidfile
else:
ctx = daemon.DaemonContext(
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=14b93b9ebbe6a16c9ffe7be5491f56fa0c564f85
commit 14b93b9ebbe6a16c9ffe7be5491f56fa0c564f85
Author: Caleb Callaway <enlightened.despot@gmail.com>
Date: Sat Aug 17 23:26:44 2013 -0700
-n switch for nslcd (prevents process from forking)
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index 8cc29c6..59323eb 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -81,6 +81,9 @@
/* flag to indicate if we are in debugging mode */
static int nslcd_debugging = 0;
+/* flag to indicate we shouldn't daemonize */
+static int nslcd_nofork = 0;
+
/* flag to indicate user requested the --check option */
static int nslcd_checkonly = 0;
@@ -126,6 +129,7 @@ static void display_usage(FILE *fp, const char
*program_name)
fprintf(fp, "Name Service LDAP connection daemon.\n");
fprintf(fp, " -c, --check check if the daemon already is running\n");
fprintf(fp, " -d, --debug don't fork and print debugging to
stderr\n");
+ fprintf(fp, " -n, --nofork don't fork\n");
fprintf(fp, " --help display this help and exit\n");
fprintf(fp, " --version output version information and exit\n");
fprintf(fp, "\n" "Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
@@ -135,11 +139,12 @@ static void display_usage(FILE *fp, const char
*program_name)
static struct option const nslcd_options[] = {
{"check", no_argument, NULL, 'c'},
{"debug", no_argument, NULL, 'd'},
+ {"nofork", no_argument, NULL, 'n'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};
-#define NSLCD_OPTIONSTRING "cdhV"
+#define NSLCD_OPTIONSTRING "cndhV"
/* parse command line options and save settings in struct */
static void parse_cmdline(int argc, char *argv[])
@@ -156,6 +161,9 @@ static void parse_cmdline(int argc, char *argv[])
nslcd_debugging++;
log_setdefaultloglevel(LOG_DEBUG);
break;
+ case 'n': /* -n, --nofork don't fork */
+ nslcd_nofork++;
+ break;
case 'h': /* --help display this help and exit */
display_usage(stdout, argv[0]);
exit(EXIT_SUCCESS);
@@ -697,7 +705,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
/* daemonize */
- if ((!nslcd_debugging) && (daemon(0, 0) < 0))
+ if ((!nslcd_debugging) && (!nslcd_nofork) && (daemon(0, 0) < 0))
{
log_log(LOG_ERR, "unable to daemonize: %s", strerror(errno));
exit(EXIT_FAILURE);
-----------------------------------------------------------------------
Summary of changes:
man/nslcd.8.xml | 12 ++++++++++++
man/pynslcd.8.xml | 12 ++++++++++++
nslcd/nslcd.c | 12 ++++++++++--
pynslcd/pynslcd.py | 13 ++++++++++---
4 files changed, 44 insertions(+), 5 deletions(-)
hooks/post-receive
--
nss-pam-ldapd
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/
- nss-pam-ldapd branch master updated. 0.9.0-39-gcda6dcd,
Commits of the nss-pam-ldapd project