# 8. Managing the Service
Day-to-day and maintenance tasks for the Windows service itself.
# Check status
sc query TotumService
Or run status.bat from the repo if you use that script.
| State | Meaning |
|---|---|
RUNNING |
Healthy baseline |
STOPPED |
Not processing — start it |
START_PENDING |
Still starting — wait a few seconds |
# Start and stop
Elevated Command Prompt or PowerShell:
net start TotumService
net stop TotumService
Or:
sc start TotumService
sc stop TotumService
# Update to a new build (from source)
- Stop the service (or use a redeploy script).
- Publish a fresh executable:
publish.bat
- Reinstall or replace as your process requires:
install.bat
When prompted about an existing service, choose the option to recreate/update so the service points at the new TotumService.exe.
Alternative: redeploy.bat (Administrator) automates stop → publish → recreate → start. Prefer publish.bat’s publish flags when diagnosing SQLite / native library issues.
# Uninstall
Uninstall.bat
Run as Administrator. Confirm when asked. This removes the Windows service entry; it does not necessarily delete your Data databases or logs unless your process includes that.
# After reboot
With default install (start= auto), TotumService should start with Windows. Verify with sc query TotumService after a reboot if uploads seem idle.
# Where files live (typical source install)
| Item | Typical location |
|---|---|
| Executable | TotumService\bin\Release\net8.0\win-x64\publish\TotumService.exe |
| Config | Same folder: appsettings.json, appsettings.Production.json |
| Databases | Data\ under the publish folder |
| Logs | logs\ under the publish folder |
| Static web UI | Plugins\WebMonitoring\wwwroot\ (copied beside the exe) |
Installer-based installs use the path chosen in the setup wizard (often under Program Files or a Totum folder).
# Running without the Windows service (developers / diagnosis)
From the publish folder, you can run TotumService.exe interactively to see console logs. Stop it with Ctrl+C. Do not leave two copies fighting for the same port (55000) or databases.
Set environment if needed:
set DOTNET_ENVIRONMENT=Production