#!/usr/share/greenos-http-api/bin/python
#
# Thin wrapper: delegates to greenos-http-api package entry point.
# The actual API server code lives in the greenos-http-api .deb package
# at /usr/share/greenos-http-api/bin/greenos-http-api-server.
#
# This file is shipped by greenos-1x only to satisfy the systemd
# ExecStart path at /usr/libexec/greenos/services/greenos-http-api-server.

import os
import sys

REAL_SERVER = "/usr/share/greenos-http-api/bin/greenos-http-api-server"

if not os.path.exists(REAL_SERVER):
    print(f"ERROR: {REAL_SERVER} not found. Install the greenos-http-api package.", file=sys.stderr)
    sys.exit(1)

# exec replaces this process entirely
os.execv(sys.executable, [sys.executable, REAL_SERVER])
