docs: align oscam docs with markdown rules authored by tem_invictus's avatar tem_invictus
...@@ -30,11 +30,12 @@ oscam -b -c /etc/oscam -t /var/tmp/oscam -B /var/run/oscam.pid ...@@ -30,11 +30,12 @@ oscam -b -c /etc/oscam -t /var/tmp/oscam -B /var/run/oscam.pid
Configure where OSCam looks for configuration files and stores temporary data. Configure where OSCam looks for configuration files and stores temporary data.
| Option | Description | Default | | Option | Description | Default |
|--------|-------------|---------| | --- | --- | --- |
| `-c, --config-dir <dir>` | Configuration files directory | `/usr/local/etc` | | `-c, --config-dir <dir>` | Configuration files directory | `/usr/local/etc` |
| `-t, --temp-dir <dir>` | Temporary files directory | `/tmp/.oscam` (Linux/macOS)<br>`OS-TMP` (Cygwin) | | `-t, --temp-dir <dir>` | Temporary files directory | `/tmp/.oscam` (Linux/macOS); `OS-TMP` (Cygwin) |
**Example:** **Example:**
```bash ```bash
oscam -c /etc/oscam -t /var/tmp/oscam oscam -c /etc/oscam -t /var/tmp/oscam
``` ```
...@@ -44,17 +45,19 @@ oscam -c /etc/oscam -t /var/tmp/oscam ...@@ -44,17 +45,19 @@ oscam -c /etc/oscam -t /var/tmp/oscam
Control how OSCam runs as a system process. Control how OSCam runs as a system process.
| Option | Description | Notes | | Option | Description | Notes |
|--------|-------------|-------| | --- | --- | --- |
| `-b, --daemon` | Run as background daemon | Standard mode for production | | `-b, --daemon` | Run as background daemon | Standard mode for production |
| `-f, --foreground` | Run in foreground | Only on STAPI/STAPI5 systems | | `-f, --foreground` | Run in foreground | Only on STAPI/STAPI5 systems |
| `-B, --pidfile <file>` | Create PID file at specified path | Useful for init scripts | | `-B, --pidfile <file>` | Create PID file at specified path | Useful for init scripts |
| `-w, --wait <seconds>` | Wait for system clock sync at startup | Default: `60` seconds | | `-w, --wait <seconds>` | Wait for system clock sync at startup | Default: `60` seconds |
**Daemon vs Foreground:** **Daemon vs Foreground:**
- Use `-b` (daemon) for most systems to run OSCam in the background - Use `-b` (daemon) for most systems to run OSCam in the background
- Use `-f` (foreground) on STAPI/STAPI5 systems or when debugging - Use `-f` (foreground) on STAPI/STAPI5 systems or when debugging
**Example:** **Example:**
```bash ```bash
oscam -b -B /var/run/oscam.pid -w 30 oscam -b -B /var/run/oscam.pid -w 30
``` ```
...@@ -64,18 +67,19 @@ oscam -b -B /var/run/oscam.pid -w 30 ...@@ -64,18 +67,19 @@ oscam -b -B /var/run/oscam.pid -w 30
Configure how OSCam handles restart requests (requires WebIf module). Configure how OSCam handles restart requests (requires WebIf module).
| Option | Description | | Option | Description |
|--------|-------------| | --- | --- |
| `-r, --restart <level>` | Set restart level (see table below) | | `-r, --restart <level>` | Set restart level (see table below) |
**Restart Levels:** **Restart Levels:**
| Level | Behavior | Use Case | | Level | Behavior | Use Case |
|-------|----------|----------| | --- | --- | --- |
| `0` | Exit on restart request | Manual control only | | `0` | Exit on restart request | Manual control only |
| `1` | WebIf restart enabled (default) | Normal operation | | `1` | WebIf restart enabled (default) | Normal operation |
| `2` | Restart on segfaults | Automatic recovery | | `2` | Restart on segfaults | Automatic recovery |
**Example:** **Example:**
```bash ```bash
oscam -b -r 2 # Restart automatically on crashes oscam -b -r 2 # Restart automatically on crashes
``` ```
...@@ -87,12 +91,13 @@ Control OSCam's logging behavior and verbosity. ...@@ -87,12 +91,13 @@ Control OSCam's logging behavior and verbosity.
### Basic Logging Options ### Basic Logging Options
| Option | Description | Default | | Option | Description | Default |
|--------|-------------|---------| | --- | --- | --- |
| `-I, --syslog-ident <ident>` | Syslog identifier | `oscam` | | `-I, --syslog-ident <ident>` | Syslog identifier | `oscam` |
| `-S, --show-sensitive` | Show sensitive data (serials, IDs) | Disabled (filtered) | | `-S, --show-sensitive` | Show sensitive data (serials, IDs) | Disabled (filtered) |
| `-d, --debug <level>` | Debug level mask | `0` (no debug) | | `-d, --debug <level>` | Debug level mask | `0` (no debug) |
**Example:** **Example:**
```bash ```bash
oscam -I oscam-server -S -d 255 oscam -I oscam-server -S -d 255
``` ```
...@@ -102,7 +107,7 @@ oscam -I oscam-server -S -d 255 ...@@ -102,7 +107,7 @@ oscam -I oscam-server -S -d 255
Debug levels use bitmask values that can be combined by adding them together. Debug levels use bitmask values that can be combined by adding them together.
| Value | Component | What It Logs | | Value | Component | What It Logs |
|-------|-----------|--------------| | --- | --- | --- |
| `0` | None | No extra debugging (default) | | `0` | None | No extra debugging (default) |
| `1` | Errors | Detailed error messages | | `1` | Errors | Detailed error messages |
| `2` | Cards | ATR parsing, ECM, EMM, and CW dumps | | `2` | Cards | ATR parsing, ECM, EMM, and CW dumps |
...@@ -144,7 +149,7 @@ oscam -d 65535 ...@@ -144,7 +149,7 @@ oscam -d 65535
Optimize OSCam's performance for your specific setup. Optimize OSCam's performance for your specific setup.
| Option | Description | Default | Maximum | | Option | Description | Default | Maximum |
|--------|-------------|---------|---------| | --- | --- | --- | --- |
| `-p, --pending-ecm <num>` | Maximum pending ECM packets | `32` | `4096` | | `-p, --pending-ecm <num>` | Maximum pending ECM packets | `32` | `4096` |
This setting controls the ECM queue size. Increase for high-traffic setups: This setting controls the ECM queue size. Increase for high-traffic setups:
...@@ -158,16 +163,18 @@ oscam -p 128 # For busy servers ...@@ -158,16 +163,18 @@ oscam -p 128 # For busy servers
Advanced options for troubleshooting and development (not recommended for production). Advanced options for troubleshooting and development (not recommended for production).
| Option | Description | Requirements | | Option | Description | Requirements |
|--------|-------------|--------------| | --- | --- | --- |
| `-a, --crash-dump` | Write `oscam.crash` on segfault | GDB installed, debug binary | | `-a, --crash-dump` | Write `oscam.crash` on segfault | GDB installed, debug binary |
| `-s, --capture-segfaults` | Capture segmentation faults | - | | `-s, --capture-segfaults` | Capture segmentation faults | - |
| `-g, --gcollect <mode>` | Garbage collector debug mode | - | | `-g, --gcollect <mode>` | Garbage collector debug mode | - |
**Garbage Collector Modes:** **Garbage Collector Modes:**
- `1` - Immediate free (detect memory issues) - `1` - Immediate free (detect memory issues)
- `2` - Check for double frees - `2` - Check for double frees
**Example:** **Example:**
```bash ```bash
oscam -a -s -g 2 # Full crash debugging oscam -a -s -g 2 # Full crash debugging
``` ```
...@@ -177,11 +184,12 @@ oscam -a -s -g 2 # Full crash debugging ...@@ -177,11 +184,12 @@ oscam -a -s -g 2 # Full crash debugging
Get information about OSCam without starting the server. Get information about OSCam without starting the server.
| Option | Description | | Option | Description |
|--------|-------------| | --- | --- |
| `-h, --help` | Display help text | | `-h, --help` | Display help text |
| `-V, --build-info` | Show build configuration and version | | `-V, --build-info` | Show build configuration and version |
**Examples:** **Examples:**
```bash ```bash
# Show help # Show help
oscam -h oscam -h
...@@ -193,6 +201,7 @@ oscam -V ...@@ -193,6 +201,7 @@ oscam -V
## Complete Examples ## Complete Examples
### Production Setup ### Production Setup
```bash ```bash
# Reliable production configuration # Reliable production configuration
oscam -b \ oscam -b \
...@@ -204,6 +213,7 @@ oscam -b \ ...@@ -204,6 +213,7 @@ oscam -b \
``` ```
### Development & Testing ### Development & Testing
```bash ```bash
# Debug client issues # Debug client issues
oscam -c /etc/oscam \ oscam -c /etc/oscam \
...@@ -212,6 +222,7 @@ oscam -c /etc/oscam \ ...@@ -212,6 +222,7 @@ oscam -c /etc/oscam \
``` ```
### High-Performance Server ### High-Performance Server
```bash ```bash
# Optimized for many clients # Optimized for many clients
oscam -b \ oscam -b \
...@@ -222,6 +233,7 @@ oscam -b \ ...@@ -222,6 +233,7 @@ oscam -b \
``` ```
### Troubleshooting ### Troubleshooting
```bash ```bash
# Maximum debugging # Maximum debugging
oscam -d 65535 \ oscam -d 65535 \
...@@ -233,18 +245,21 @@ oscam -d 65535 \ ...@@ -233,18 +245,21 @@ oscam -d 65535 \
## Best Practices ## Best Practices
### For Production ### For Production
- Always use `-b` (daemon mode) on standard systems - Always use `-b` (daemon mode) on standard systems
- Set `-r 2` for automatic recovery from crashes - Set `-r 2` for automatic recovery from crashes
- Use `-B` with pidfile for proper init script integration - Use `-B` with pidfile for proper init script integration
- Keep debug level at `0` unless troubleshooting - Keep debug level at `0` unless troubleshooting
### For Testing ### For Testing
- Use meaningful syslog identifiers with `-I` when running multiple instances - Use meaningful syslog identifiers with `-I` when running multiple instances
- Enable sensitive data logging `-S` only during active troubleshooting - Enable sensitive data logging `-S` only during active troubleshooting
- Combine debug levels to focus on specific components - Combine debug levels to focus on specific components
- Remember to disable debug logging after troubleshooting - Remember to disable debug logging after troubleshooting
### For Development ### For Development
- Use crash dumps `-a` only with debug builds - Use crash dumps `-a` only with debug builds
- Monitor memory with garbage collector `-g` during testing - Monitor memory with garbage collector `-g` during testing
- Test restart behavior with `-r` levels before deployment - Test restart behavior with `-r` levels before deployment
...@@ -252,14 +267,17 @@ oscam -d 65535 \ ...@@ -252,14 +267,17 @@ oscam -d 65535 \
## Platform-Specific Notes ## Platform-Specific Notes
**STAPI/STAPI5 Systems:** **STAPI/STAPI5 Systems:**
- Use `-f` (foreground) instead of `-b` (daemon) - Use `-f` (foreground) instead of `-b` (daemon)
- These platforms require foreground operation - These platforms require foreground operation
**Embedded Devices:** **Embedded Devices:**
- Use lower `-w` values (10-20 seconds) if clock sync is fast - Use lower `-w` values (10-20 seconds) if clock sync is fast
- Consider smaller `-p` values (16-32) if memory is limited - Consider smaller `-p` values (16-32) if memory is limited
**Multi-Instance Setups:** **Multi-Instance Setups:**
- Use unique `-I` identifiers for each instance - Use unique `-I` identifiers for each instance
- Specify different `-t` temp directories for each instance - Specify different `-t` temp directories for each instance
- Use separate `-B` pidfiles for process management - Use separate `-B` pidfiles for process management
\ No newline at end of file