You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/sys-apps/calculate-server/files/calculate-server-2.1.14-add...

55 lines
2.2 KiB

commit 14b241a66ec2e749ed0b1cae3576bcbac025d2df
Author: Mike Hiretsky <mh@calculate.ru>
Date: Mon Jun 27 12:17:16 2011 +0400
Add maildomain group to unix during mail service setup.
diff --git a/pym/cl_ldap.py b/pym/cl_ldap.py
index e1c6eae..ebab6bd 100644
--- a/pym/cl_ldap.py
+++ b/pym/cl_ldap.py
@@ -4695,6 +4695,22 @@ if you want to continue to run the program again"))
self.clVars.Set("sr_mail_host", fullHostName, True)
return True
+ def addDefaultMailGroup(self):
+ """Add default mail group to unix"""
+ mailGroup = self.defaultUnixGroup["name"]
+ if not self.servUnixObj.searchUnixGroupName(mailGroup):
+ # Если нужно создаем новую Unix группу
+ unixGroupFullName = self.defaultUnixGroup["comment"]
+ optGroupUnix = {"c": unixGroupFullName}
+ if not self.servUnixObj.addGroupUnixServer(mailGroup,
+ optGroupUnix,
+ False):
+ self.printERROR (_("Can not add group")+ " " +\
+ str(mailGroup) + _(" in Unix service"))
+ return False
+ return True
+
+
def setupMailServer(self, options):
"""Начальная настройка Mail сервиса"""
# Принудительная установка
@@ -4876,6 +4892,10 @@ if you want to continue to run the program again"))
return False
else:
self.printOK(msgStartSort)
+
+ if not self.addDefaultMailGroup():
+ return False
+
textLines = self.execProg("/etc/init.d/postfix start")
if textLines == False:
self.printNotOK(_("Starting") + " " + "Postfix" + " ...")
@@ -7686,6 +7706,9 @@ outdated. If the backup is obsolete, use cl-backup."))
for service in servicesRestart:
if service in "ldap":
continue
+ if service in "mail":
+ if not self.servMailObj.addDefaultMailGroup():
+ return False
if not self.stopServices([service]):
flagError = True
break