summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAeneas Jai├čle <aj@ajaissle.de>2014-08-19 11:35:02 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-19 11:35:02 +0200
commitf40f94e60cdb3b07c76408acf9d64f680a0b82ab (patch)
tree75e8bb525abb9efc85e8d425a672f20baa638662
parentb7448315c76685b66a74368aa6bbfd70c5d7b531 (diff)
downloadpykolab-f40f94e60cdb3b07c76408acf9d64f680a0b82ab.tar.gz
This patch adds an option '--socket' that can be used when starting kolab-saslauthd, to specify the socket file to bind to.
-rw-r--r--pykolab/conf/__init__.py10
-rw-r--r--saslauthd/__init__.py9
-rw-r--r--saslauthd/kolab-saslauthd.sysvinit4
3 files changed, 23 insertions, 0 deletions
diff --git a/pykolab/conf/__init__.py b/pykolab/conf/__init__.py
index 030a626..e05f140 100644
--- a/pykolab/conf/__init__.py
+++ b/pykolab/conf/__init__.py
@@ -590,6 +590,16 @@ class Conf(object):
except IOError, e:
log.error(_("Cannot start SASL authentication daemon"))
return False
+ elif os.path.isfile("/var/run/sasl2/mux"):
+ if os.path.isfile("/var/run/sasl2/saslauthd.pid"):
+ log.error(_("Cannot start SASL authentication daemon"))
+ return False
+ else:
+ try:
+ os.remove("/var/run/sasl2/mux")
+ except IOError, e:
+ log.error(_("Cannot start SASL authentication daemon"))
+ return False
return True
def check_setting_use_imap(self, value):
diff --git a/saslauthd/__init__.py b/saslauthd/__init__.py
index 32927a8..b7f81d5 100644
--- a/saslauthd/__init__.py
+++ b/saslauthd/__init__.py
@@ -68,6 +68,15 @@ class SASLAuthDaemon(object):
)
daemon_group.add_option(
+ "-s",
+ "--socket",
+ dest = "socketfile",
+ action = "store",
+ default = "/var/run/saslauthd/mux",
+ help = _("Socket file to bind to.")
+ )
+
+ daemon_group.add_option(
"-u",
"--user",
dest = "process_username",
diff --git a/saslauthd/kolab-saslauthd.sysvinit b/saslauthd/kolab-saslauthd.sysvinit
index 033bbc7..5090a65 100644
--- a/saslauthd/kolab-saslauthd.sysvinit
+++ b/saslauthd/kolab-saslauthd.sysvinit
@@ -24,7 +24,11 @@ if [ -f /etc/init.d/functions ]; then
fi
# Source our configuration file for these variables.
+if [[ -d /var/run/sasl2 ]]; then
+SOCKETDIR=/var/run/sasl2
+else
SOCKETDIR=/var/run/saslauthd
+fi
FLAGS="--fork -l warning"
if [ -f /etc/sysconfig/kolab-saslauthd ] ; then