WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
run as service (Read 4596 times)
spoppe
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
run as service
Oct 5th, 2005 at 1:27pm
 
I succesfully created a job which starts a batch file that monitors files in a specified directory and depending on the action (delete or insert), updates a table in an Oracle database.  When I try to start this job as a service, nothing happens, no triggering actions occur.  Can someone help me with this issue?  Thanks, greets
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2363
The Netherlands
Re: run as service
Reply #1 - Oct 5th, 2005 at 1:59pm
 
You'll have to remember that when you run as a service, no user is logged in. This means that network-drives are not mapped (X:\ is not present).

To "debug" this, let the service start a .bat file with only this line inside:
Code:
echo started for file %WD_FILE% >> c:\temp\debug.txt 



That will "prove" that watchDirectory is reacting to filesystem changes.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
spoppe
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Re: run as service
Reply #2 - Oct 6th, 2005 at 12:39pm
 
Run your batch file as service works correctly.  Is it possible to monitor network directories ?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2363
The Netherlands
Re: run as service
Reply #3 - Oct 6th, 2005 at 5:19pm
 
[quote]Run your batch file as service works correctly.  Is it possible to monitor network directories ?[/quote]

Yes, you can monitor the UNC name (\\server\share\directory). However, the Service, by default, runs as the "user" LocalSystem. The LocalSystem user can do anything you want on the [b]local[/b] computer, but normally has very limited rights to the network.

Also, your .bat file can not use mapped drives (X:), but should use UNC names as well.


You can use the standard Windows Services applet (on the control panel) to change the user that this watchdirectory task runs. If you use a userid that *has* access to the network folder, it should be ok. Note that the user needs extra privileges to "run as a service". For example, administrators have those privileges. Normal users need the additional "act as part of the operating system" privilege (see the security policy applet).

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1