def get_pid(node, service):
    """ Uses systemctl to obtain the PID of a running service

    Return type is Integer.
    Returns 0 for a service that does not exist or is not running.

    Arguments:
    node -- A modular framework node object that supports the Bash shell
    service -- The name of the service
    """
    output = node("systemctl show {service} "
                  "--property=MainPID | cat".format(**locals()),
                  shell="bash")
    # Expected output of systemctl status is similar to the following.
    # For a not running or unexisting service, the output is MainPID=0
    #
    # bash-4.3# systemctl show ops-sysd --property=MainPID | cat
    # MainPID=1760
    lines = output.split('=')
    return int(lines[1]) if len(lines) > 1 else 0