Skip to content

Commit 7968197

Browse files
committed
Update command syntax to use 'uv run python -m linux_edr.cli run' instead of 'linux-edr run'
1 parent e05ce72 commit 7968197

5 files changed

Lines changed: 39 additions & 23 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ uv pip install git+https://github.com/ParttimeWorks/linux_edr.git@v1.0.0
3636

3737
```bash
3838
# Basic monitoring with default settings
39-
linux-edr run
39+
sudo uv run python -m linux_edr.cli run
4040

4141
# Custom interval and output file
42-
linux-edr run --interval 5 --output events.jsonl
42+
sudo uv run python -m linux_edr.cli run --interval 5 --output events.jsonl
4343

4444
# Using a specific configuration file
45-
linux-edr run --config /etc/linux_edr/custom.ini
45+
sudo uv run python -m linux_edr.cli run --config /etc/linux_edr/custom.ini
4646

4747
# Show current configuration
48-
linux-edr show-config
48+
sudo uv run python -m linux_edr.cli show-config
4949
```
5050

5151
## Data Structure

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Linux EDR captures process execution data through Linux's kernel tracing capabil
2121

2222
```bash
2323
# Run with default settings (requires root permissions)
24-
sudo linux-edr run
24+
sudo uv run python -m linux_edr.cli run
2525

2626
# Monitor with 5-minute report interval
27-
sudo linux-edr run --interval 5
27+
sudo uv run python -m linux_edr.cli run --interval 5
2828

2929
# Save reports to file
30-
sudo linux-edr run --output /var/log/linux-edr.jsonl
30+
sudo uv run python -m linux_edr.cli run --output /var/log/linux-edr.jsonl
3131
```
3232

3333
## Architecture

docs/usage.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Usage
22

3-
The `linux-edr` command provides the main interface for running and managing the EDR tool.
3+
The Linux EDR tool can be run directly using the Python module.
44

55
## Running the Monitor
66

77
```bash
88
# Basic monitoring with default settings (requires root)
9-
sudo linux-edr run
9+
sudo uv run python -m linux_edr.cli run
1010

1111
# Custom 5-minute reporting interval and save reports to a file
12-
sudo linux-edr run --interval 5 --output /var/log/linux-edr-events.jsonl
12+
sudo uv run python -m linux_edr.cli run --interval 5 --output /var/log/linux-edr-events.jsonl
1313

1414
# Use a specific configuration file
15-
sudo linux-edr run --config /etc/linux_edr/my_config.ini
15+
sudo uv run python -m linux_edr.cli run --config /etc/linux_edr/my_config.ini
1616
```
1717

1818
## Viewing Configuration
1919

2020
To see the effective configuration (after loading defaults, file settings, and command-line overrides):
2121

2222
```bash
23-
linux-edr show-config
23+
sudo uv run python -m linux_edr.cli show-config
2424

2525
# View configuration based on a specific file
26-
linux-edr show-config --config /etc/linux_edr/my_config.ini
26+
sudo uv run python -m linux_edr.cli show-config --config /etc/linux_edr/my_config.ini
2727
```
2828

2929
## Running as a Systemd Service
@@ -34,27 +34,32 @@ Linux EDR can be run as a systemd service for continuous background monitoring:
3434
```bash
3535
sudo cp linux-edr.service /etc/systemd/system/
3636
```
37-
*(Note: Ensure the `linux-edr.service` file is present in your installation or repository.)*
37+
*(Note: The service file is configured to use `uv run python -m linux_edr.cli run` command)*
3838

3939
2. **Create log directory** (if needed by your service configuration):
4040
```bash
4141
sudo mkdir -p /var/log/linux-edr
4242
sudo chown <user>:<group> /var/log/linux-edr # Adjust user/group as needed
4343
```
4444

45-
3. **Reload systemd, enable and start the service:**
45+
3. **Ensure uv is installed system-wide and available at /usr/bin/uv:**
46+
```bash
47+
sudo ln -sf $(which uv) /usr/bin/uv # Create symlink if necessary
48+
```
49+
50+
4. **Reload systemd, enable and start the service:**
4651
```bash
4752
sudo systemctl daemon-reload
4853
sudo systemctl enable linux-edr.service
4954
sudo systemctl start linux-edr.service
5055
```
5156

52-
4. **Check service status:**
57+
5. **Check service status:**
5358
```bash
5459
sudo systemctl status linux-edr.service
5560
```
5661

57-
5. **View service logs:**
62+
6. **View service logs:**
5863
```bash
5964
sudo journalctl -u linux-edr.service -f
6065
```

install_service.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,22 @@ fi
99

1010
echo "Installing Linux EDR service..."
1111

12-
# Install the Python package if not already installed
13-
pip show linux-edr > /dev/null 2>&1 || {
14-
echo "Installing Linux EDR Python package..."
15-
pip install .
16-
}
12+
# Check if uv is installed
13+
if ! command -v uv &> /dev/null; then
14+
echo "Error: 'uv' is required but not found. Please install uv first."
15+
echo "Visit: https://github.com/astral-sh/uv"
16+
exit 1
17+
fi
18+
19+
# Create symlink to uv in /usr/bin if it doesn't exist
20+
if [ ! -f /usr/bin/uv ]; then
21+
echo "Creating symlink for uv in /usr/bin..."
22+
ln -sf $(which uv) /usr/bin/uv
23+
fi
24+
25+
# Install the Python package in development mode
26+
echo "Installing Linux EDR Python package..."
27+
uv pip install -e .
1728

1829
# Create log directory
1930
echo "Creating log directory..."

linux-edr.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ After=network.target
66
Type=simple
77
User=root
88
ExecStartPre=/bin/sh -c 'echo 1 > /sys/kernel/tracing/events/syscalls/sys_enter_execve/enable'
9-
ExecStart=/usr/local/bin/linux-edr --output-file /var/log/linux-edr/reports.jsonl
9+
ExecStart=/usr/bin/uv run python -m linux_edr.cli run --output /var/log/linux-edr/reports.jsonl
1010
Restart=on-failure
1111
RestartSec=5
1212
StandardOutput=journal

0 commit comments

Comments
 (0)