Good day.
I've been playing around with various ways to keep VD running when I need it in XP, so here are a few things of interest.
EDIT: Read the replies for a solution to really running VD as a service...
A few notes regarding --backEnd (see https://vitamind.fogbugz.com/default.asp?video.1.156.3):
- It's case-sensitive, "BackEnd" wont work.
- It's needed to run the Agent silently; somehow it's clueless as to its default storage location.
- You cannot use --backEnd to relocate VD storage; if you do, some files will still end-up in the default location.
- If you want to move the VD storage, use a junction/link. This is the only way to point several users to the same database.
- The "Video" (rather than the "Agent") program also has a backEnd option (this gives interesting results, like 5x the video process).
- IMPORTANT: If you start the Agent at a time not covered by a rule, the Agent quits ---> SEE NOTE (*) <---
Solution #1 - Using Task Scheduler
You can use Task Scheduler (and a slew of tasks) to run the VD Agent at various times; waking-up the computer from StandBy along the way if you want to, and killing the Agent with --quit at specific times if you want the PC to go to StandBy again later. Use the same user for all tasks, so the VD database is always at the same place. If you intend to browse the database while logged as various other users, use Junctions in everyone's profiles and point the database to a shared location that everyone has access to.
So to simulate running VD as a service between 8am and 5pm for instance, you could:
- Use task scheduler to start the Agent on system startup (using --backEnd).
- Create another task to start the Agent at 8am (required if you dont have 24h rules).
- Create another task to start the Agent on logon (for when you switch users, see caveat below).
- Create another task to stop the Agent at 5pm with --quit.
The only thing missing is starting the Agent on logoff; task scheduler does not have this option. Instead, you could use group policy to add a logoff script and START the Agent inside the script (make sure you "CD" to VD's install folder when you start it or it will fail to open cameras, and use junctions and move the VD datastore to some shared location if you have multiple users on the PC) ---> SEE REPLY BELOW, THIS DOES NOT WORK <---
Caveat to running VD with task scheduler: I'm not quite sure why (because it works when the Agent runs under LocalService) but while the Agent is running under a specific user (as started with Task Scheduler), then if you run the "Video" frontEnd under another user, it will be unable to "connect" to your cameras. You can review recorded video just fine, but you can't watch live camera feeds.
NOTE (*)
When I first started testing this solution, I noticed that if I started the Agent with --backEnd outside of a time that was covered by an active RULE in VD, then the Agent would run and quit a few seconds later, never spawning its 3 child processes. I tested this several times, and this was the behaviour. So long as I was using Task Scheduler to start VD, it was no issue (in fact it was somewhat useful). So if your VD Agent exibits this behaviour, and if you want to truly run VD as a service (see below) then you will need a 24h rule or VD will not always start.
Then a few days later, this behaviour stopped, and my Agent was happily starting and spawning 3 copies of itself even if no RULE was active at that time. This is how it currently behaves. I have no idea what has changed to make it behave as such, but it is the behaviour you need to be able to run it as a service even if you do not have 24/7 rules in VD.
Regards,
