def start(self, foreground=False):
        log.info("Starting")
        pid = self.pid()

        if pid:
            # Check if the pid in the pidfile corresponds to a running process
            if pid_exists(pid):
                log.error("Not starting, another instance is already running"
                          " (using pidfile {0})".format(self.pidfile))
                sys.exit(1)
            else:
                log.warn('pidfile contains the pid of a stopped process.'
                         ' Starting normally')

        log.info(self.pidfile % "Pidfile: %s")
        if not foreground:
            self.daemonize()
        self.write_pidfile()
        self.run()
dataset/ETHPy150Open serverdensity/sd-agent/daemon.py/Daemon.start/swapped operands of `%`