2
# Rob Crittenden <rcritten@redhat.com>
4
# Copyright (C) 2011 Red Hat
5
# see file 'COPYING' for use and warranty information
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
from ipalib import api
21
from ipalib import errors
22
from ipalib import Updater, Object
23
from ipaserver.install import service
24
from ipaserver.install.plugins import PRE_UPDATE, POST_UPDATE, MIDDLE
26
class DSRestart(service.Service):
28
Restart the 389-ds service.
32
This class is present to provide ldapupdate the means to
35
service.Service.__init__(self, "dirsrv")
37
def start(self, instance_name="", capture_output=True, wait=True):
39
During upgrades the server is listening only on the socket so
40
we don't want to wait on ports. The caller is responsible for
41
waiting for the socket to be ready.
43
super(DSRestart, self).start(wait=False)
45
def create_instance(self):
46
self.step("stopping directory server", self.stop)
47
self.step("starting directory server", self.start)
48
self.start_creation(start_message="Restarting Directory server "
49
"to apply updates", show_service_name=False)
53
Generic object used to register all updates into a single namespace.
55
backend_name = 'ldap2'
59
class PreUpdate(Updater):
61
Base class for updates that run prior to file processing.
63
updatetype = PRE_UPDATE
67
super(PreUpdate, self).__init__()
69
class PostUpdate(Updater):
71
Base class for updates that run after file processing.
73
updatetype = POST_UPDATE
77
super(PostUpdate, self).__init__()