How to start a service manually?

There’s a service mainly for running a test with some test case. And I’ve put io.rancher.container.start_once: 'true' on it.

Now I want the service stay on “stop” state after rancher-compose up, so I can start it manually on Rancher-UI, run the test and read the output log.

Anyway to achieve the above? Thanks~

1 Like

I’m not sure if I completely follow what you are trying to do, but here’s what I think would work in your use case.

Launch a service that has io.rancher.container.start_once: 'true' in it.
Assuming your container will automatically exit (as you would use the label so that after it exits, it wouldn’t try to launch another container), the state of the service would be Started-Once in the UI.

In the UI, you can click on the container in the service and select “Start” to have the container start up again and read the output log, but you’d have to read it before the container stops again.

If your container is not going to automatically stop and exit, then you don’t need the label. You can create the service using rancher-compose create, which creates them in the UI but does not start them. Then, when you are ready to run the test, you could start the service in the UI and read the output log.