Update service and installation guide with correct server paths
- Change user from root to dalim - Update working directory to /home/dalim/BISSELL-WRIKE - Use virtual environment python at /home/dalim/BISSELL-WRIKE/bissell-wrike/bin/python3 - Update all installation commands to use venv - Add venv activation steps throughout guide - Add ownership commands for dalim user
This commit is contained in:
parent
4fd9bbb1fc
commit
4ca48bd1df
2 changed files with 39 additions and 18 deletions
|
|
@ -6,7 +6,8 @@ This guide covers installing the **wrike_monitor_lgl.py** service for the LGL Te
|
|||
|
||||
- Linux server with systemd
|
||||
- Python 3.6 or higher
|
||||
- Root or sudo access
|
||||
- User account: `dalim`
|
||||
- Sudo access for service installation
|
||||
- Active Wrike API token with access to LGL Team space
|
||||
|
||||
## Installation Steps
|
||||
|
|
@ -15,26 +16,36 @@ This guide covers installing the **wrike_monitor_lgl.py** service for the LGL Te
|
|||
|
||||
```bash
|
||||
# Create installation directory
|
||||
sudo mkdir -p /root/wrike-import
|
||||
sudo mkdir -p /home/dalim/BISSELL-WRIKE
|
||||
|
||||
# Create virtual environment
|
||||
cd /home/dalim/BISSELL-WRIKE
|
||||
python3 -m venv bissell-wrike
|
||||
|
||||
# Copy files to server
|
||||
sudo cp wrike_monitor_lgl.py /root/wrike-import/
|
||||
sudo cp requirements.txt /root/wrike-import/
|
||||
sudo cp wrike_monitor_lgl.py /home/dalim/BISSELL-WRIKE/
|
||||
sudo cp requirements.txt /home/dalim/BISSELL-WRIKE/
|
||||
sudo cp wrike-monitor-lgl.service /etc/systemd/system/
|
||||
|
||||
# Set ownership
|
||||
sudo chown -R dalim:dalim /home/dalim/BISSELL-WRIKE
|
||||
```
|
||||
|
||||
### 2. Install Python Dependencies
|
||||
|
||||
```bash
|
||||
cd /root/wrike-import
|
||||
cd /home/dalim/BISSELL-WRIKE
|
||||
|
||||
# Activate virtual environment
|
||||
source bissell-wrike/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
pip3 install -r requirements.txt
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 3. Configure the Script
|
||||
|
||||
Edit `/root/wrike-import/wrike_monitor_lgl.py` and update paths (lines 41-44):
|
||||
Edit `/home/dalim/BISSELL-WRIKE/wrike_monitor_lgl.py` and update paths (lines 41-44):
|
||||
|
||||
```python
|
||||
# === PATHS (EDIT FOR SERVER) ===
|
||||
|
|
@ -65,8 +76,13 @@ sudo chmod 755 /path/to/processed
|
|||
Before enabling the service, test the script manually:
|
||||
|
||||
```bash
|
||||
cd /root/wrike-import
|
||||
python3 wrike_monitor_lgl.py
|
||||
cd /home/dalim/BISSELL-WRIKE
|
||||
|
||||
# Activate virtual environment
|
||||
source bissell-wrike/bin/activate
|
||||
|
||||
# Run the script
|
||||
python wrike_monitor_lgl.py
|
||||
```
|
||||
|
||||
**Expected output:**
|
||||
|
|
@ -207,9 +223,10 @@ sudo journalctl -u wrike-monitor-lgl.service -n 50
|
|||
```
|
||||
|
||||
**Common issues:**
|
||||
- Python dependencies not installed → Run `pip3 install -r requirements.txt`
|
||||
- Python dependencies not installed → Activate venv and run `pip install -r requirements.txt`
|
||||
- Incorrect paths in script → Edit paths in wrike_monitor_lgl.py
|
||||
- Permissions issues → Check folder permissions and ownership
|
||||
- Permissions issues → Check folder permissions: `sudo chown -R dalim:dalim /home/dalim/BISSELL-WRIKE`
|
||||
- Virtual environment not activated → Service uses venv python at `/home/dalim/BISSELL-WRIKE/bissell-wrike/bin/python3`
|
||||
- API token invalid → Verify token in script configuration
|
||||
|
||||
### Service Crashes/Restarts
|
||||
|
|
@ -246,8 +263,9 @@ sudo journalctl -u wrike-monitor-lgl.service | grep -i "error\|exception\|failed
|
|||
sudo systemctl stop wrike-monitor-lgl.service
|
||||
|
||||
# Run manually to see errors
|
||||
cd /root/wrike-import
|
||||
python3 wrike_monitor_lgl.py
|
||||
cd /home/dalim/BISSELL-WRIKE
|
||||
source bissell-wrike/bin/activate
|
||||
python wrike_monitor_lgl.py
|
||||
```
|
||||
|
||||
### Duplicate Files Still Being Created
|
||||
|
|
@ -296,7 +314,10 @@ To update the script:
|
|||
sudo systemctl stop wrike-monitor-lgl.service
|
||||
|
||||
# Update the script
|
||||
sudo cp new_wrike_monitor_lgl.py /root/wrike-import/wrike_monitor_lgl.py
|
||||
sudo cp new_wrike_monitor_lgl.py /home/dalim/BISSELL-WRIKE/wrike_monitor_lgl.py
|
||||
|
||||
# Set ownership
|
||||
sudo chown dalim:dalim /home/dalim/BISSELL-WRIKE/wrike_monitor_lgl.py
|
||||
|
||||
# Start the service
|
||||
sudo systemctl start wrike-monitor-lgl.service
|
||||
|
|
@ -321,7 +342,7 @@ sudo rm /etc/systemd/system/wrike-monitor-lgl.service
|
|||
sudo systemctl daemon-reload
|
||||
|
||||
# Optionally remove installation directory
|
||||
sudo rm -rf /root/wrike-import
|
||||
sudo rm -rf /home/dalim/BISSELL-WRIKE
|
||||
```
|
||||
|
||||
## Support
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/root/wrike-import
|
||||
ExecStart=/usr/bin/python3 /root/wrike-import/wrike_monitor_lgl.py
|
||||
User=dalim
|
||||
WorkingDirectory=/home/dalim/BISSELL-WRIKE
|
||||
ExecStart=/home/dalim/BISSELL-WRIKE/bissell-wrike/bin/python3 /home/dalim/BISSELL-WRIKE/wrike_monitor_lgl.py
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue