diff --git a/hack/conf.d/ucloud-host b/hack/conf.d/ucloud-host new file mode 100644 index 0000000..d1dd8d1 --- /dev/null +++ b/hack/conf.d/ucloud-host @@ -0,0 +1 @@ +HOSTNAME=server1.place10 \ No newline at end of file diff --git a/hack/rc-scripts/ucloud-api b/hack/rc-scripts/ucloud-api new file mode 100644 index 0000000..eb7f83e --- /dev/null +++ b/hack/rc-scripts/ucloud-api @@ -0,0 +1,8 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +pidfile="/var/run/${name}.pid" +command="$(which pipenv)" +command_args="run python ucloud.py api" +command_background="true" +directory="/root/ucloud" \ No newline at end of file diff --git a/hack/rc-scripts/ucloud-host b/hack/rc-scripts/ucloud-host new file mode 100644 index 0000000..0aa375f --- /dev/null +++ b/hack/rc-scripts/ucloud-host @@ -0,0 +1,8 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +pidfile="/var/run/${name}.pid" +command="$(which pipenv)" +command_args="run python ucloud.py host ${HOSTNAME}" +command_background="true" +directory="/root/ucloud" \ No newline at end of file diff --git a/hack/rc-scripts/ucloud-scheduler b/hack/rc-scripts/ucloud-scheduler new file mode 100644 index 0000000..00c0a36 --- /dev/null +++ b/hack/rc-scripts/ucloud-scheduler @@ -0,0 +1,8 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +pidfile="/var/run/${name}.pid" +command="$(which pipenv)" +command_args="run python ucloud.py scheduler" +command_background="true" +directory="/root/ucloud" \ No newline at end of file diff --git a/host/main.py b/host/main.py index a51e09a..c5c5887 100755 --- a/host/main.py +++ b/host/main.py @@ -76,7 +76,7 @@ def main(hostname): host_pool = HostPool(etcd_client, env_vars.get('HOST_PREFIX')) host = next(filter(lambda h: h.hostname == hostname, host_pool.hosts), None) - assert host is not None, "No such host" + assert host is not None, "No such host with name = {}".format(hostname) try: heartbeat_updating_process.start()