Skip to content

Kubernetes: gateway: start services via docker-systemctl-replacement#3584

Merged
un-def merged 1 commit intomasterfrom
pr_k8s_gateway_init
Feb 19, 2026
Merged

Kubernetes: gateway: start services via docker-systemctl-replacement#3584
un-def merged 1 commit intomasterfrom
pr_k8s_gateway_init

Conversation

@un-def
Copy link
Collaborator

@un-def un-def commented Feb 18, 2026

  • ensures all enabled services are running
  • acts as a proper init (PID 1) - reaps zombies, handles signals, etc.

- ensures all enabled services are running
- acts as a proper init (PID 1) - reaps zombies, handles signals, etc.
@un-def
Copy link
Collaborator Author

un-def commented Feb 18, 2026

Before:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0   2892  1768 ?        Ss   10:46   0:00 /bin/sh -c apt-get update && apt-get install -y sudo wget openssh-server nginx python3.10-venv libaugeas0 && wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/b18d67e521f0d1cf1d705dbb8e0416bef23e377c/files/docker/systemctl3.py -O /usr/bin/systemctl && chmod a+rx /usr/bin/systemctl && python3 -m venv /root/certbotvenv/ && /root/certbotvenv/bin/pip install certbot-nginx && ln -s /root/certbotvenv/bin/certbot /usr/bin/certbot && sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config && useradd -mUG sudo ubuntu && echo 'ubuntu ALL=(ALL:ALL) NOPASSWD: ALL' | tee /etc/sudoers.d/ubuntu && mkdir -p /run/sshd /home/ubuntu/.ssh && chmod 700 /home/ubuntu/.ssh && echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY1ZwYMRd9ji0JG7ggCLD/FpaoMGdYDEoA+cfzl7o4hqJYH271jTUclXE71CGseoxVMiIGzCNCRiTSDbe1xsCy0c7aNbRKxSR/53c6+4MlLy+NhNSWtR5IkaSjHE51U/n5YtixNeDDSsb7ZEAE1GGLgJmsFdgXSPdb3z3mvmvmsJi/1IiCVQT3DIPl9/NqRePuDUNDdhiYVKaXj3mGmlZ8D4N2cJKC4KQbnNT4Y6wsetghRCxB8DHyM2O1bzJh4wVjv3Fd991LpsUyoKic3MVDcvVD3XWRHvELcgILNiJp8LS/0unAbFlTuxmUGfZEc15K6j92YgHFdCZWs89zmfSz dstack' > /home/ubuntu/.ssh/authorized_keys && chmod 600 /home/ubuntu/.ssh/authorized_keys && chown -R ubuntu:ubuntu /home/ubuntu/.ssh && rm -rf /etc/ssh/ssh_host_* && ssh-keygen -A > /dev/null && /usr/sbin/sshd -p 22 -o PermitUserEnvironment=yes && su ubuntu -c 'mkdir -p /home/ubuntu/dstack && python3 -m venv /home/ubuntu/dstack/blue && python3 -m venv /home/ubuntu/dstack/green && /home/ubuntu/dstack/blue/bin/pip install '"'"'dstack-gateway @ https://dstack-gateway-downloads.s3.amazonaws.com/stgn/dstack_gateway-6596-py3-none-any.whl'"'"' && sudo /home/ubuntu/dstack/blue/bin/python -m dstack.gateway.systemd install --run' && sleep infinity
root        4540  0.0  0.0  15440  5616 ?        Ss   10:46   0:00 sshd: /usr/sbin/sshd -p 22 -o PermitUserEnvironment=yes [listener] 0 of 10-100 startups
ubuntu      4652  0.0  0.0   2892  1672 ?        Ss   10:47   0:00 /bin/sh /home/ubuntu/dstack/start.sh
ubuntu      4655  1.0  0.4 157696 71640 ?        Sl   10:47   0:00 /home/ubuntu/dstack/blue/bin/python3 /home/ubuntu/dstack/blue/bin/uvicorn dstack.gateway.main:app
root        4661  0.0  0.0   2792  1504 ?        S    10:47   0:00 sleep infinity

After:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.1  0.2 112680 33080 ?        Ss   10:59   0:00 /usr/bin/python3 /usr/bin/systemctl default
ubuntu      4631  0.0  0.0   2892  1696 ?        Ss   10:59   0:00 /bin/sh /home/ubuntu/dstack/start.sh
ubuntu      4634  4.4  0.4 157708 71904 ?        Sl   10:59   0:00 /home/ubuntu/dstack/blue/bin/python3 /home/ubuntu/dstack/blue/bin/uvicorn dstack.gateway.main:app
root        4644  0.0  0.0  55344  6016 ?        Ss   10:59   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
root        4650  0.0  0.0  15440  9484 ?        Ss   10:59   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
www-data    4652  0.0  0.0  55960  5816 ?        S    10:59   0:00 nginx: worker process
www-data    4653  0.0  0.0  55960  5816 ?        S    10:59   0:00 nginx: worker process
www-data    4654  0.0  0.0  55960  5816 ?        S    10:59   0:00 nginx: worker process
www-data    4655  0.0  0.0  55960  5816 ?        S    10:59   0:00 nginx: worker process

@un-def un-def requested a review from r4victor February 18, 2026 13:15
@un-def un-def merged commit e165684 into master Feb 19, 2026
28 checks passed
@un-def un-def deleted the pr_k8s_gateway_init branch February 19, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments