def main(argv):
    if 2 > len(argv):
        print_usage(argv)
        return

    daemon_factory_pipe_name = argv[1]
    fi, fo = os.pipe()
    halt_dtg = SBusDatagram.create_service_datagram(SBUS_CMD_HALT, fo)
    n_status = SBus.send(daemon_factory_pipe_name, halt_dtg)
    if 0 > n_status:
        print('Sending failed')
    else:
        print('Sending succeeded')
        cmd_response = os.read(fi, 256)
        print(cmd_response)
    os.close(fi)
    os.close(fo)
dataset/ETHPy150Open openstack/storlets/Engine/SMScripts/send_halt_cmd_to_daemon_factory.py/main/original