(self)
Deconfigure archiving, attempt to stop syncdaemon
Deconfigure archiving, attempt to stop syncdaemon
Deconfigure archiving attempt to stop syncdaemon
def master_stop(self):
        """Deconfigure archiving, attempt to stop syncdaemon"""
        data_dir = self.cf.getfile("master_data")
        restart_cmd = self.cf.getfile("master_restart_cmd", "")

        self.assert_is_master(True)
        self.log.info("Disabling WAL archiving")

        self.master_configure_archiving(False, restart_cmd)

        # if we have a restart command, then use it, otherwise signal
        if restart_cmd:
            self.log.info("Restarting postmaster")
            self.exec_system(restart_cmd)
        else:
            self.log.info("Sending SIGHUP to postmaster")
            self.signal_postmaster(data_dir, signal.SIGHUP)

        # stop any running syncdaemons
        pidfile = self.cf.getfile("pidfile", "")
        if os.path.exists(pidfile):
            self.log.info('Pidfile %s exists, attempting to stop syncdaemon.', pidfile)
            self.exec_cmd([self.script, self.cfgfile, "syncdaemon", "-s"])

        self.log.info("Done")
def master_stop ( self ) : data_dir = self . cf . getfile ( "master_data" ) restart_cmd = self . cf . getfile ( "master_restart_cmd" , "" ) self . assert_is_master ( True ) self . log . info ( "Disabling WAL archiving" ) self . master_configure_archiving ( False , restart_cmd ) # if we have a restart command, then use it, otherwise signal if restart_cmd : self . log . info ( "Restarting postmaster" ) self . exec_system ( restart_cmd ) else : self . log . info ( "Sending SIGHUP to postmaster" ) self . signal_postmaster ( data_dir , signal . SIGHUP ) # stop any running syncdaemons pidfile = self . cf . getfile ( "pidfile" , "" ) if os . path . exists ( pidfile ) : self . log . info ( 'Pidfile %s exists, attempting to stop syncdaemon.' , pidfile ) self . exec_cmd ( [ self . script , self . cfgfile , "syncdaemon" , "-s" ] ) self . log . info ( "Done" )