summaryrefslogtreecommitdiffstats
path: root/pykolab/setup/services.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/setup/services.py')
-rw-r--r--pykolab/setup/services.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/pykolab/setup/services.py b/pykolab/setup/services.py
index a836a5a..ae4eecd 100644
--- a/pykolab/setup/services.py
+++ b/pykolab/setup/services.py
@@ -142,6 +142,12 @@ def find_file(name, paths):
return full_path
return None
+def find_path(paths):
+ for path in paths:
+ if exists(path):
+ return path
+ return None
+
def readfile(filename):
f = open(filename)
try:
@@ -450,10 +456,7 @@ def have_mysql_process():
return have_process_with_file(pidfile)
def get_mysql_defaults():
- for path in '/etc/mysql/debian.cnf', '/etc/mysql/my.cnf', '/etc/my.cnf':
- if exists(path):
- return path
- return None
+ return find_path(['/etc/mysql/debian.cnf', '/etc/mysql/my.cnf', '/etc/my.cnf'])
def make_mysql_defaults_file(defaults_file):
utils.multiline_message(
@@ -489,6 +492,18 @@ def have_cyrus_imapd():
def have_dovecot_imapd():
return exists('/etc/dovecot')
+def get_cyrus_config_base():
+ return find_path(['/var/lib/imap', '/var/lib/cyrus'])
+
+def get_cyrus_spool_base():
+ return find_path(['/var/spool/imap', '/var/spool/cyrus'])
+
+def get_cyrus_sieve_base():
+ return find_path(['/var/lib/imap/sieve', '/var/spool/sieve'])
+
+def get_cyrus_socket_base():
+ return find_path(['/var/lib/imap/socket', '/var/run/cyrus/socket'])
+
# LDAP-related functions.
def have_slapd():