rfswift container stop
Stop a running container.
rfswift container stop stops a running container without deleting it. Its files and settings are kept; only the programs running inside stop. Use it to free memory and CPU when you are done for the day.
rfswift container stop -c my_sdr_containerTo start it again, enter it with rfswift container shell: a stopped container is started for you.
Other spellings: the legacy form rfswift stop and the short alias rfswift halt still work and print a notice. The flags are the same. See the command tree.
Synopsis
rfswift container stop -c CONTAINER_NAMEOptions
| Flag | Description | Required | Example |
|---|---|---|---|
-c, --container STRING |
Container name or ID to stop | Yes | -c my_container |
Container picker: without -c in an interactive terminal, RF Swift shows a picker with only the running containers (name, ID, image and state).
Examples
Basic usage
Stop a specific container
rfswift container stop -c my_sdr_containerStop by container ID
rfswift container stop -c a1b2c3d4e5f6Stop with short container ID
rfswift container stop -c a1b2c3Everyday cases
End of work day
# Stop assessment container for the day
rfswift container stop -c client_assessment
# Resume tomorrow
rfswift container shell -c client_assessmentFree up resources
# Stop idle containers to free memory
rfswift container stop -c sdr_capture
rfswift container stop -c wifi_analysis
rfswift container stop -c bluetooth_scannerBefore system maintenance
To stop every running RF Swift container at once, for example before a system update:
# Stop all RF Swift containers before a system update
for container in $(docker ps -q --filter "ancestor=penthertz/rfswift_resolute"); do
rfswift container stop -c $container
doneTake a break
rfswift container stop -c long_running_capture # stop it
rfswift container shell -c long_running_capture # pick up again laterWhat happens when you stop a container
Data persistence
What is kept when a container stops:
- every file inside the container, and your workspace and mounted folders;
- its settings: bindings, capabilities, port and network settings.
What is lost:
- the programs running inside: they are terminated;
- whatever was only in memory: the container is not hibernated.
Example
# Create container with captures
rfswift container create -i sdr_full -n capture_session -b ~/captures:/root/captures
# Inside container: Start long capture
rfswift container shell -c capture_session
rtl_sdr -f 100M -s 2.4M capture.dat &
exit
# Stop container
rfswift container stop -c capture_session
# Process terminates, but files in ~/captures persist
# Resume later
rfswift container shell -c capture_session
ls /root/captures # Files still thereProcess handling
The container shuts down gracefully:
- Docker sends SIGTERM to every process.
- The processes get 10 seconds to clean up.
- Any process still running then gets SIGKILL.
- The container stops.
Keep this in mind for long captures (data still being written may be lost), databases (let them finish writing) and network services (open connections are dropped).
Container state after stop
# Check container status
docker ps -a | grep my_container
# Output shows:
# STATUS: Exited (0) 2 minutes agoA stopped container still exists: you can start it again, commit it to an image or remove it. It uses no CPU and no memory, but it still takes disk space.
Stop vs exit
| Operation | container stop |
exit (from the shell) |
|---|---|---|
| Run from | Your computer | Inside the container |
| Stops the container | Always | Only if nothing else is running inside |
| Graceful shutdown | Yes | Depends |
| Use it when | You are done with the container for now | You are done with this shell |
Workflow comparison
# Using exit (from inside container)
rfswift container shell -c my_container
# ... work ...
exit
# Container may still be running if background processes exist
# Using stop (from host)
rfswift container stop -c my_container
# Container definitely stops, all processes terminateCommon workflows
Daily work cycle
# Monday: Create container
rfswift container create -i network -n weekly_work -b ~/work:/root/work
# Monday-Friday: Use throughout week
rfswift container shell -c weekly_work
# ... work ...
exit
# Each evening: Stop to free resources
rfswift container stop -c weekly_work
# Each morning: Resume
rfswift container shell -c weekly_work # Auto-starts
# Friday: Clean up when done
rfswift container rm -c weekly_workResource management
# List running containers
docker ps
# Stop idle containers
rfswift container stop -c sdr_test1
rfswift container stop -c old_assessment
rfswift container stop -c experiment_containerContainer lifecycle management
# Week 1: Create and use
rfswift container create -i sdr_full -n project_alpha
# Week 1-2: Use daily
rfswift container shell -c project_alpha
# Weekend: Stop to save resources
rfswift container stop -c project_alpha
# Week 3: Resume
rfswift container shell -c project_alpha
# Project complete: Remove if not needed anymore
rfswift container rm -c project_alphaBatch container management
# Stop multiple related containers
CONTAINERS="capture1 capture2 capture3"
for container in $CONTAINERS; do
echo "Stopping $container..."
rfswift container stop -c $container
done
# Or using docker directly
docker stop capture1 capture2 capture3Troubleshooting
Container already stopped
You try to stop a container that is already stopped.
rfswift container stop -c my_container
# Error: Container is not runningTo fix it:
# Check if running
docker ps | grep my_container
# If not in output, it's already stopped
docker ps -a | grep my_container
# No action neededContainer not found
The error message is: Error: No such container: container_name
To fix it:
# List all containers
rfswift container last
# Container may have been removed
# Need to create new one
rfswift container create -i image -n container_nameContainer won’t stop
The container doesn’t stop after a reasonable time.
To fix it:
# Wait longer (some containers need cleanup time)
rfswift container stop -c my_container
# Wait 30-60 seconds
# Force stop with Docker
docker kill my_container # Immediate force stop
# Check what's preventing shutdown
docker logs my_containerMultiple containers with similar names
The name you gave matches more than one container.
To fix it:
# Use full name
rfswift container stop -c full_container_name
# Use container ID
docker ps # Get ID
rfswift container stop -c a1b2c3d4e5f6
# List to identify
rfswift container lastPermission denied
You can’t stop the container because your user can’t talk to Docker yet (Linux).
To fix it, give your user access once (no logout needed), then try again:
rfswift host docker-access
rfswift container stop -c my_containerOr, by hand:
sudo usermod -aG docker $USER
newgrp docker
rfswift container stop -c my_containerData loss concerns
You are worried about losing data when you stop a container.
Verification
# Check mounted volumes
docker inspect my_container | grep -A 10 Mounts
# Data in mounted volumes is safe
# Data in container filesystem is preserved when stopped
# Only running processes and RAM contents are lost
# To be extra safe, commit before stopping
rfswift container commit -c my_container -i backup_image
rfswift container stop -c my_containerRelated commands
container create: create a new containercontainer shell: enter a container (starts it if stopped)container rm: delete a container for goodcontainer last: list recent containers with their statuscontainer commit: save a container’s state as an image
Running captures are stopped too. Any capture or long-running program inside the container is terminated when it stops. Let it finish, or save its output, before you stop the container.
Tip: to stop idle containers every night, put the loop from Before system maintenance in a script and schedule it with cron, for example 0 2 * * * /path/to/stop_idle_containers.sh.