Bug 612 - creat service with service.conf in present directory and auto load it
creat service with service.conf in present directory and auto load it
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.4.22
Other Windows
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-29 08:21 CEST by lenovo_me
Modified: 2014-09-29 11:29 CEST (History)
1 user (show)

See Also:


Attachments
SYSLOG (148.51 KB, image/jpeg)
2014-09-29 09:50 CEST, lenovo_me
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lenovo_me 2014-09-29 08:21:08 CEST
I downloaded no install binaries unbound-1.4.22.zip and unzip it to E:\Program Files\unbound\,then run unbound-service-install.exe to creat service,However,it dose not load E:\Program Files\unbound\service.conf but trying to load C:\Program Files\unbound\service.conf,Because C:\Program Files\unbound\service.conf does not exist,it load the default config and record an error in syslog.
I think it is not a bug,but if users use no install binaries,it should load service.conf in present directory.

Now I use command line to create unbound service to avoid this error:
sc create unbound binpath= "\"e:\Program Files\unbound\unbound.exe\" -c \"e:\Program Files\unbound\service.conf\" -w service" displayname= "Unbound DNS validator" start= auto
Comment 1 Wouter Wijngaards 2014-09-29 09:29:57 CEST
Hi Lenovo_me,

So the unbound-service-install.exe picks up the path to itself (in winrc/w_inst.c:195) and then replaces its own name with "unbound.exe".  This is what it then registers.  So, from the code it seems like it should be trying to do what you want it to do.  What went wrong for you?

Did you run unbound-service-install.exe from another directory?
Did you rename unbound-service-install.exe ?

Best regards,
  Wouter
Comment 2 lenovo_me 2014-09-29 09:50:19 CEST
Created attachment 262 [details]
SYSLOG
Comment 3 lenovo_me 2014-09-29 09:52:10 CEST
Did you run unbound-service-install.exe from another directory?
NO
Did you rename unbound-service-install.exe ?
NO
Comment 4 Wouter Wijngaards 2014-09-29 10:02:58 CEST
Hi Lenovo_me,

Thank you for the syslog screenshot.  The executable path is okay, but the config file path is wrong, just like you told me.  I'll change the code.

Best regards,
   Wouter
Comment 5 Wouter Wijngaards 2014-09-29 11:29:44 CEST
Hi lenovo_me,

The fixed code is in the code repository.  Thank you for the report.

Best regards, Wouter