Skip to content

Add write commands to horustctl#309

Open
FedericoPonzi wants to merge 9 commits into
masterfrom
fponzi/horustctl-write
Open

Add write commands to horustctl#309
FedericoPonzi wants to merge 9 commits into
masterfrom
fponzi/horustctl-write

Conversation

@FedericoPonzi
Copy link
Copy Markdown
Owner

@FedericoPonzi FedericoPonzi commented Mar 21, 2026

Motivation and Context

Fixes: #31

Description

Horustctl was created as part of pr: #200. Later that pr was splitted in smaller more digestible PRs, while refactoring the codebase as well. The current horustctl support only querying the status of the supervised services. This PR add support for changing a single service status using the horustcli.

CLI tool for interacting with a running Horust instance.

Usage: horustctl [OPTIONS] <COMMAND>

Commands:
  status   Show the status of one or all services
  start    Start a stopped service
  stop     Stop a running service
  restart  Restart a service (stop then start)
  help     Print this message or the help of the given subcommand(s)

Options:
  -p, --pid <PID>
          The pid of the horust process you want to query. Optional if only one horust is running in the system
  -u, --uds-folder-path <UDS_FOLDER_PATH>
          [default: /var/run/horust/]
      --socket-path <SOCKET_PATH>
          
  -h, --help
          Print help
  -V, --version
          Print version

How Has This Been Tested?

Unit and Integration tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@FedericoPonzi FedericoPonzi force-pushed the fponzi/horustctl-write branch from 535ec47 to b1093e4 Compare March 21, 2026 17:20
@FedericoPonzi FedericoPonzi requested a review from kemingy March 21, 2026 20:34
@kemingy

This comment was marked as resolved.

@FedericoPonzi

This comment was marked as resolved.

@FedericoPonzi FedericoPonzi force-pushed the fponzi/horustctl-write branch from 2196b1d to c82733e Compare March 29, 2026 16:58
Comment thread horust/src/horust/commands_handler.rs
Comment thread horust/src/horust/commands_handler.rs Outdated
Comment thread horust/src/horust/supervisor/service_handler.rs Outdated
@FedericoPonzi FedericoPonzi force-pushed the fponzi/horustctl-write branch from f6151e2 to d1b347c Compare April 1, 2026 20:47
Copy link
Copy Markdown
Collaborator

@kemingy kemingy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question. Previously, horust works as a container init process, so it exits when all the services are done. But now when we use horustctl to control the services lifecycle, if we stop all the services, the horust will exit, there is no room for horustctl to start those services since the uds is gone. I'm not sure if this is something we should change.

Comment thread commands/src/commands.proto Outdated
Comment thread horust/src/horust/commands_handler.rs
@FedericoPonzi
Copy link
Copy Markdown
Owner Author

I have a question. Previously, horust works as a container init process, so it exits when all the services are done. But now when we use horustctl to control the services lifecycle, if we stop all the services, the horust will exit, there is no room for horustctl to start those services since the uds is gone. I'm not sure if this is something we should change.

Do you have any recommendations/suggestions? The rationale behind horustctl is that some users asked for it and in some cases it comes as a deciding factor on adoption apparently.

I agree, I don't see much of a reason to use horustctl inside a container, but maybe there are cases in which it might be helpful. I think it might be helpful if a user wants to run horust outside a container as well. Let me know what you think!

@kemingy
Copy link
Copy Markdown
Collaborator

kemingy commented Apr 9, 2026

I have a question. Previously, horust works as a container init process, so it exits when all the services are done. But now when we use horustctl to control the services lifecycle, if we stop all the services, the horust will exit, there is no room for horustctl to start those services since the uds is gone. I'm not sure if this is something we should change.

Do you have any recommendations/suggestions? The rationale behind horustctl is that some users asked for it and in some cases it comes as a deciding factor on adoption apparently.

I agree, I don't see much of a reason to use horustctl inside a container, but maybe there are cases in which it might be helpful. I think it might be helpful if a user wants to run horust outside a container as well. Let me know what you think!

It seems ochinchina/supervisord has an explicit ctl shutdown cmd. I would prefer explicit than implicit.

We shall not break the current horust logic. So maybe add keep_alive = false (or another name for this purpose) to HorustConfig? What do you think?

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.

Create horustctl for controlling horust via cli

2 participants