Skip to content

Commit ca09963

Browse files
authored
Updated README.md
1 parent bedee8a commit ca09963

File tree

5 files changed

+910
-11
lines changed

5 files changed

+910
-11
lines changed

AUTO_START_STATUS.md

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
# Auto-Start Status - ENABLED
2+
3+
## Current Configuration
4+
5+
Your auto-start is **ALREADY ENABLED** in `.env`:
6+
7+
```env
8+
LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true
9+
```
10+
11+
This means:
12+
- ✅ Services automatically start when controller starts
13+
- ✅ No manual clicking required
14+
- ✅ Works on every reboot if you've set up Windows auto-start
15+
16+
---
17+
18+
## What Happens When You Start the Controller
19+
20+
When you run `start.bat` or `npm run dev`:
21+
22+
1. **Controller starts** - Web server launches on port 5010
23+
2. **Auto-start kicks in** - Scans database for services
24+
3. **Services launch** - All services with `start_command` get started
25+
4. **Dashboard opens** - Browser opens to http://localhost:5010
26+
5. **You see status** - Green "Running" badges for started services
27+
28+
**You'll see this in the terminal:**
29+
```
30+
============================================================
31+
Auto-starting 3 service(s)
32+
============================================================
33+
Starting: My API Service... ✓ Started
34+
Starting: My Web App... ✓ Started
35+
Starting: Background Worker... ✓ Started
36+
============================================================
37+
Auto-start complete
38+
============================================================
39+
```
40+
41+
---
42+
43+
## If You're Still Seeing Errors
44+
45+
### Scenario 1: "No services to auto-start"
46+
47+
**What you see:**
48+
```
49+
No services to auto-start (all services already running or no start commands defined)
50+
```
51+
52+
**Why:**
53+
- You haven't added any services yet
54+
- Services don't have `start_command` defined
55+
- All services are already running
56+
57+
**Fix:**
58+
1. Open dashboard: http://localhost:5010
59+
2. Go to: Services
60+
3. Add services or check existing ones have start commands
61+
62+
---
63+
64+
### Scenario 2: "✗ Error: ..." for specific service
65+
66+
**What you see:**
67+
```
68+
Starting: My Service... ✗ Error: [Errno 2] No such file or directory
69+
```
70+
71+
**Why:**
72+
- Service has wrong working directory
73+
- Dependencies not installed
74+
- Command not found (missing Python, Node, etc.)
75+
76+
**Fix:**
77+
1. Open dashboard: http://localhost:5010
78+
2. Click the service name
79+
3. Check "Last Error" field
80+
4. Fix the issue (see AUTO_START_TROUBLESHOOTING.md)
81+
5. Restart controller
82+
83+
---
84+
85+
### Scenario 3: Service shows "Stopped" in dashboard
86+
87+
**What you see:**
88+
- Service exists in dashboard
89+
- Status shows "Stopped" (gray)
90+
- Never auto-started
91+
92+
**Why:**
93+
- Service has no `start_command` defined
94+
95+
**Fix:**
96+
1. Click the service name
97+
2. Add a `start_command` like:
98+
```
99+
python app.py
100+
npm start
101+
node server.js
102+
```
103+
3. Save
104+
4. Restart controller (auto-start will pick it up)
105+
106+
---
107+
108+
## Quick Diagnostic
109+
110+
### Check Configuration
111+
Double-click: `CHECK_AUTO_START.bat`
112+
113+
This shows:
114+
- Auto-start enabled/disabled
115+
- Port and host settings
116+
- Database status
117+
- Next steps
118+
119+
### Check Service Logs
120+
121+
**Via Dashboard:**
122+
1. Go to http://localhost:5010
123+
2. Click "Services"
124+
3. Click a service name
125+
4. Scroll down to "Logs" section
126+
127+
**Via File System:**
128+
```
129+
Open: data/logs/
130+
```
131+
132+
Each service has its own log file showing:
133+
- Startup output
134+
- Runtime logs
135+
- Error messages
136+
137+
---
138+
139+
## How To Test Auto-Start
140+
141+
### Test 1: Restart Controller
142+
143+
1. Close controller window (or Ctrl+C)
144+
2. Run: `start.bat`
145+
3. Watch terminal for auto-start messages
146+
4. Check dashboard for green "Running" statuses
147+
148+
### Test 2: Add New Service
149+
150+
1. Go to http://localhost:5010
151+
2. Click "Services" → "New Service"
152+
3. Fill in:
153+
- Name: Test Service
154+
- Start Command: `python -m http.server 8888`
155+
- Working Directory: `C:\Users\nedpe`
156+
- Port: 8888
157+
4. Click "Create Service"
158+
5. Restart controller
159+
6. Should auto-start on next launch
160+
161+
### Test 3: Check Process Manager
162+
163+
1. Press Ctrl+Shift+Esc (Task Manager)
164+
2. Look for processes:
165+
- `python.exe` (for Python services)
166+
- `node.exe` (for Node services)
167+
- Other runtimes
168+
3. Count should match number of running services
169+
170+
---
171+
172+
## Windows Auto-Start vs Service Auto-Start
173+
174+
These are TWO DIFFERENT features:
175+
176+
### Windows Auto-Start
177+
**What:** Starts the controller itself when Windows boots
178+
179+
**Configured by:**
180+
- Double-click: `tools\ENABLE_AUTO_START.bat`
181+
- Creates Windows Task Scheduler task
182+
- Runs controller on login
183+
184+
**Status:** Check Task Scheduler for "Local Nexus Controller" task
185+
186+
### Service Auto-Start
187+
**What:** Starts services when controller starts
188+
189+
**Configured by:**
190+
- `.env` file: `LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true`
191+
- Already enabled in your setup!
192+
193+
**Status:** Check `.env` or run `CHECK_AUTO_START.bat`
194+
195+
### Complete Auto-Start Setup
196+
197+
For full automation (services start on Windows boot):
198+
199+
1. ✅ Enable service auto-start (already done!)
200+
```env
201+
LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true
202+
```
203+
204+
2. Enable Windows auto-start
205+
- Double-click: `tools\ENABLE_AUTO_START.bat`
206+
- Click "Yes" for admin access
207+
208+
3. Result:
209+
- Windows boots
210+
- Controller starts automatically
211+
- Services start automatically
212+
- Everything running, no manual steps!
213+
214+
---
215+
216+
## Troubleshooting Flow
217+
218+
```
219+
Start controller
220+
221+
Does terminal show "Auto-starting X service(s)"?
222+
↓ YES ↓ NO
223+
↓ ↓
224+
Any "✗ Error" messages? Check .env file
225+
↓ YES ↓ NO LOCAL_NEXUS_AUTO_START_ALL_ON_BOOT=true?
226+
↓ ↓ ↓ NO
227+
↓ ↓ └→ Enable it, restart
228+
↓ ↓
229+
Read error Check dashboard ↓ YES
230+
↓ Services page ↓
231+
↓ Look for green Do services have start_command?
232+
↓ "Running" status ↓ NO
233+
↓ └→ Add start commands
234+
↓ ↓ YES
235+
Fix issue └→ Check service logs
236+
237+
Restart controller
238+
```
239+
240+
---
241+
242+
## Common Patterns
243+
244+
### Pattern 1: Everything Works
245+
```
246+
Terminal shows: "Auto-starting 5 service(s)"
247+
Terminal shows: "✓ Started" for each service
248+
Dashboard shows: Green "Running" badges
249+
```
250+
**Action:** Nothing! You're good to go.
251+
252+
### Pattern 2: Some Services Fail
253+
```
254+
Terminal shows: "Auto-starting 5 service(s)"
255+
Terminal shows: "✓ Started" for 3 services
256+
Terminal shows: "✗ Error" for 2 services
257+
Dashboard shows: Mix of green and red statuses
258+
```
259+
**Action:** Fix the 2 failing services (check logs, fix issues)
260+
261+
### Pattern 3: No Auto-Start
262+
```
263+
Terminal shows: "No services to auto-start..."
264+
Dashboard shows: All services stopped
265+
```
266+
**Action:**
267+
- Add services if none exist
268+
- Add start_command to existing services
269+
- Check .env has auto-start enabled
270+
271+
---
272+
273+
## Next Steps
274+
275+
1. **Verify auto-start is working:**
276+
```cmd
277+
start.bat
278+
```
279+
Look for "Auto-starting X service(s)" in terminal
280+
281+
2. **Check dashboard:**
282+
http://localhost:5010 → Services
283+
284+
3. **If errors:**
285+
- Read error messages in terminal
286+
- Check service logs
287+
- See AUTO_START_TROUBLESHOOTING.md
288+
289+
4. **Enable full automation:**
290+
- Double-click: `tools\ENABLE_AUTO_START.bat`
291+
- Restart computer to test
292+
293+
---
294+
295+
## Files Created
296+
297+
- `AUTO_START_TROUBLESHOOTING.md` - Complete troubleshooting guide
298+
- `AUTO_START_STATUS.md` - This file
299+
- `CHECK_AUTO_START.bat` - Quick diagnostic tool
300+
301+
All ready to help you get services starting automatically!
302+
303+
---
304+
305+
## Summary
306+
307+
| Feature | Status | How To Configure |
308+
|---------|--------|------------------|
309+
| Service Auto-Start |**ENABLED** | Already set in `.env` |
310+
| Windows Auto-Start | ⚠️ **Check** | Run `tools\ENABLE_AUTO_START.bat` |
311+
| Auto-Discovery |**ENABLED** | Already set in `.env` |
312+
| File Watcher |**ENABLED** | Already set in `.env` |
313+
314+
Your controller is fully configured for auto-starting services. If services aren't starting, it's likely:
315+
- Missing start commands on services
316+
- Errors during startup (check logs)
317+
- Dependencies not installed
318+
319+
Run `CHECK_AUTO_START.bat` for a quick diagnostic!

0 commit comments

Comments
 (0)