# How to Restart Port 7900 Service

## Service Name
`websocket_api.service` - FastAPI WebSocket service running on port 7900

## Restart Commands

### Method 1: Restart Service (Recommended)
```bash
sudo systemctl restart websocket_api.service
```

### Method 2: Stop and Start
```bash
sudo systemctl stop websocket_api.service
sudo systemctl start websocket_api.service
```

### Method 3: Reload (if config changed)
```bash
sudo systemctl reload websocket_api.service
```

## Check Status

```bash
# Check if service is running
sudo systemctl status websocket_api.service

# Check if port 7900 is listening
sudo netstat -tlnp | grep 7900
# or
sudo ss -tlnp | grep 7900
```

## View Logs

```bash
# View recent logs
sudo journalctl -u websocket_api.service -n 50 --no-pager

# Follow logs in real-time
sudo journalctl -u websocket_api.service -f

# View logs from application file
tail -f /var/www/html/live_calls/homebook/logs/voicebot.log
```

## Manual Start (if service not working)

If you need to run it manually for testing:

```bash
cd /var/www/html/live_calls/homebook
python3 main.py
# or
/usr/bin/python3 main.py
```

## Current Status

- **Service**: `websocket_api.service`
- **Status**: Active (running)
- **Port**: 7900
- **Process**: PID 3045252
- **Command**: `/usr/bin/python3 /var/www/html/live_calls/homebook/main.py`
- **User**: vmc
- **Working Directory**: `/var/www/html/live_calls/homebook`

## Quick Restart

```bash
sudo systemctl restart websocket_api.service && sleep 2 && sudo systemctl status websocket_api.service --no-pager | head -15
```



