CLI Reference
runnem restart
Restart all services, or a specific service if specified.
Usage
runnem restart [service]
Description
The restart
command provides a convenient way to restart your services without having to manually stop and start them. It performs a graceful restart by:
- Stopping the specified service(s) (if they are running)
- Waiting briefly to ensure services are fully stopped
- Starting the service(s) again
Note: If a service is already stopped, restart
will simply start it. This makes restart
a reliable way to ensure services are running regardless of their current state.
This is particularly useful when you've made configuration changes or need to refresh service state.
Examples
# Restart all services
runnem restart
# Restart a specific service
runnem restart api
# Restart the frontend service
runnem restart frontend
How it works
Service Shutdown:
- Gracefully stops the specified service(s) using the same logic as
runnem down
- Ensures proper cleanup of resources
- Gracefully stops the specified service(s) using the same logic as
Brief Pause:
- Waits 1 second to ensure services are fully stopped
- Prevents race conditions during restart
Service Startup:
- Starts the service(s) using the same logic as
runnem up
- Respects dependencies when restarting all services
- Performs health checks if URLs are configured
- Starts the service(s) using the same logic as
Service Status
During restart, you'll see status messages:
- π Restarting services...
- π Stopped service
- π Starting service...
- β Started service (with URL if configured)
When to Use Restart
The restart
command is useful when:
- Configuration files have been updated
- Services are unresponsive but still running
- You need to refresh service state
- Environment variables have changed
- Dependencies need to be re-established
- You want to ensure a service is running (regardless of current state)
Best Practices
- Use restart instead of manual down/up sequences
- Restart specific services when only one needs refreshing
- Monitor status messages for any startup issues
- Check logs if services fail to restart properly
Next Steps
- runnem up - Learn about starting services
- runnem down - Learn about stopping services
- Service Management - Understand service lifecycle management