I have yawcam running on an old laptop (Server 2003 SP2) without much storage, so I set up a network file share (mounted as Z: drive) to a system elsewhere on my network.
If I run YawCam as a program and use motion detection, it saves to Z:\{date}\{tstamp}.jpg just fine.
If I close YawCam (to save the settings) and select to install as a service, the streaming still works (http:\\mycomputer.domain:8081) but the motion detection no longer seems to be saving images to the correct spot.
I can't see the yawcam icon in the system tray when it is running as a service, so I can't check on the settings it's useing directly.
Any recommendations what might be amiss?
Thanks!
Saving to network drive while running as a service?
-
- Moderator
- Posts: 1210
- Joined: Wed Jan 14, 2009 3:50 am
I believe the reason it doesn't save to the Z: drive when running as a service is because the "System" account on your computer doesn't have a z: drive mapped. If you run it as your user, then it uses the mapped Z: drive.
I don't know if it's actually possible to map the shared drive as a service account, but you may want to try something just because it might work...
Make a batch file with the "net use Z: \\path\share /persistent:yes" command in it, make sure you input the right path in the command, then save it somewhere like C:\. Set Yawcam's motion detection to active and put the run .exe to point to the batch file. Close Yawcam, start the service and move around to trigger the motion, which in turn will make Yawcam run the batch file as a service and map the drive for the service account. You can then delete the batch file and restart yawcam. It should save to the Z: drive.
It's a long shot, but it just might work.
z3r0c00l12
I don't know if it's actually possible to map the shared drive as a service account, but you may want to try something just because it might work...
Make a batch file with the "net use Z: \\path\share /persistent:yes" command in it, make sure you input the right path in the command, then save it somewhere like C:\. Set Yawcam's motion detection to active and put the run .exe to point to the batch file. Close Yawcam, start the service and move around to trigger the motion, which in turn will make Yawcam run the batch file as a service and map the drive for the service account. You can then delete the batch file and restart yawcam. It should save to the Z: drive.
It's a long shot, but it just might work.
z3r0c00l12
-
- Moderator
- Posts: 1210
- Joined: Wed Jan 14, 2009 3:50 am
-
- Moderator
- Posts: 1210
- Joined: Wed Jan 14, 2009 3:50 am
Thuggee, please try the first solution I provided above, it may work, I think it didn't work because the Services session is different from the console session therefore, a mapped drive in your console session might not be accessible by the Services session.
I was also thinking, you have to use an account to run your service as because you most likely don't have the permission to the shared drive using the System account.
I was also thinking, you have to use an account to run your service as because you most likely don't have the permission to the shared drive using the System account.
And you would need to ensure that the selected account used with the service also has all the relevant permission on the share too.z3r0c00l12 wrote:I was also thinking, you have to use an account to run your service as because you most likely don't have the permission to the shared drive using the System account.
I should add that using a UNC address along with an account common to both machines for the service login does allow files to be saved to a remote Windows share sans persistent mapping because this is how one of my systems is configured.