Acquire the pidfile.

        Create the pidfile, lock it, write the pid into it
        and register the release with atexit.


        :return: None
        :raise: SystemExit

def acquire(self):
        """Acquire the pidfile.

        Create the pidfile, lock it, write the pid into it
        and register the release with atexit.


        :return: None
        :raise: SystemExit
        """
        try:
            pidfile = open(self._pidfile, "a")
        except IOError as err:
            raise SystemExit(err)
        try:
            fcntl.flock(pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
        except IOError:
            raise SystemExit('Already running according to ' + self._pidfile)
        pidfile.seek(0)
        pidfile.truncate()
        pidfile.write(str(os.getpid()) + '\n')
        pidfile.flush()
        self.pidfile = pidfile
        atexit.register(self.release)