local version cannot run as service
local version cannot run as service
Hi, I just installed the official 1.2 release yesterday. Followed the installation guide and customized xml file for the ip address and domain. When running in command line mode, everything is OK. I was able to create subaccount, add sipgate provider, dialplans, and am able to make and receive GV calls.
However, when I tried to run it as service, it would fail. I did the httpcfg set urlacl command, the return result was 0 - successful. I also double checked it later with httpcfg query urlacl, the result is good (see below). installutil finished ok also, the install log seems fine. But when the service is started, it would end in a few minute, with a system event error
.Net 2.0 Runtime Error Reporting
EventType clr20r3, P1 sipsorcery-appsvr.exe, P2 1.0.0.14617, P3 4b726933, P4 sipsorcery-appsvr, P5 1.0.0.14617, P6 4b726933, P7 4f, P8 aeb, P9 system.unauthorizedaccess, P10 NIL.
It seems it is related to unauthorized accesss.
There is nothing in the logs\error.log at all.
My system is WinXP SP3, with latest updates, and all .Net latest updates also.
Can someone please help? Thanks.
C:\Program Files\sipsorcery>httpcfg query urlacl
URL : http://*:2869/
ACL : D:(A;;GX;;;LS)
------------------------------------------------------------------------------
URL : http://+:10243/WMCv2/
ACL : D:(A;OICI;KA;;;NS)
------------------------------------------------------------------------------
URL : http://+:10243/WMPNSSv3/
ACL : D:(A;OICI;KA;;;NS)
------------------------------------------------------------------------------
URL : http://+:80/Temporary_Listen_Addresses/
ACL : D:(A;;GX;;;WD)
------------------------------------------------------------------------------
URL : http://+:8080/
ACL : D:(A;;GX;;;LS)
------------------------------------------------------------------------------
However, when I tried to run it as service, it would fail. I did the httpcfg set urlacl command, the return result was 0 - successful. I also double checked it later with httpcfg query urlacl, the result is good (see below). installutil finished ok also, the install log seems fine. But when the service is started, it would end in a few minute, with a system event error
.Net 2.0 Runtime Error Reporting
EventType clr20r3, P1 sipsorcery-appsvr.exe, P2 1.0.0.14617, P3 4b726933, P4 sipsorcery-appsvr, P5 1.0.0.14617, P6 4b726933, P7 4f, P8 aeb, P9 system.unauthorizedaccess, P10 NIL.
It seems it is related to unauthorized accesss.
There is nothing in the logs\error.log at all.
My system is WinXP SP3, with latest updates, and all .Net latest updates also.
Can someone please help? Thanks.
C:\Program Files\sipsorcery>httpcfg query urlacl
URL : http://*:2869/
ACL : D:(A;;GX;;;LS)
------------------------------------------------------------------------------
URL : http://+:10243/WMCv2/
ACL : D:(A;OICI;KA;;;NS)
------------------------------------------------------------------------------
URL : http://+:10243/WMPNSSv3/
ACL : D:(A;OICI;KA;;;NS)
------------------------------------------------------------------------------
URL : http://+:80/Temporary_Listen_Addresses/
ACL : D:(A;;GX;;;WD)
------------------------------------------------------------------------------
URL : http://+:8080/
ACL : D:(A;;GX;;;LS)
------------------------------------------------------------------------------
-
- Posts: 4
- Joined: Sat Mar 06, 2010 8:03 pm
Hi,
Same issue here, but on Win 2008. Running as command line version works fine, but installed service stops unexpectedly after a minute or so. I can't see any errors logged.
Have registered namespace reservation successfully for Local Service account with
netsh http add urlacl url=http://+:8080/ user="NT Authority\Local Service"
Reserved URL : http://+:8080/
User: NT AUTHORITY\LOCAL SERVICE
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;LS)
Stephen
Same issue here, but on Win 2008. Running as command line version works fine, but installed service stops unexpectedly after a minute or so. I can't see any errors logged.
Have registered namespace reservation successfully for Local Service account with
netsh http add urlacl url=http://+:8080/ user="NT Authority\Local Service"
Reserved URL : http://+:8080/
User: NT AUTHORITY\LOCAL SERVICE
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;LS)
Stephen
Something should definitely be showing up in the log files.
One thing that will prevent that is if the user the service is running under doesn't have permissions to ovewrrite any existing log files. Before starting the service delete all the files in the sipsorcery log directory.
The only thing that stops the service being able to start at all is a malformed configuration file. But if you can start the application as a console then that's not an issue since the service and console modes both use the same file.
The reservation of the HTTP namespaces will cause issues for the operation of the sipsorcery application but won't stop it starting up and will result in a warning message being written to the log file.
Regards,
Aaron
One thing that will prevent that is if the user the service is running under doesn't have permissions to ovewrrite any existing log files. Before starting the service delete all the files in the sipsorcery log directory.
The only thing that stops the service being able to start at all is a malformed configuration file. But if you can start the application as a console then that's not an issue since the service and console modes both use the same file.
The reservation of the HTTP namespaces will cause issues for the operation of the sipsorcery application but won't stop it starting up and will result in a warning message being written to the log file.
Regards,
Aaron
-
- Posts: 4
- Joined: Sat Mar 06, 2010 8:03 pm
Hi,
I fixed the log permissions problems and found the error - the PersistenceConnStr value was just "xmlconfig" which worked fine when running as a console, but when running as a service this eventually results in an error like cannot find "c:\windows\system32\xmlconfig"
I'm not sure why though, as far as I can see the connection string gets prepended with AppDomain.CurrentDomain.BaseDirectory which I thought should point to the right place.
Thanks,
Stephen
I fixed the log permissions problems and found the error - the PersistenceConnStr value was just "xmlconfig" which worked fine when running as a console, but when running as a service this eventually results in an error like cannot find "c:\windows\system32\xmlconfig"
I'm not sure why though, as far as I can see the connection string gets prepended with AppDomain.CurrentDomain.BaseDirectory which I thought should point to the right place.
Thanks,
Stephen
Hi Stephen,
I found that issue as well. When I was testing I had my windows service working correctly with just xmlconfig and AppDomain.CurrentDomain.BaseDirectory. I obviously missed something and will revisit it at some point. The simple fix is to fully qualify the direcrtory and file paths in the sipsorcery-appsvr.exe.config file.
Regards,
Aaron
I found that issue as well. When I was testing I had my windows service working correctly with just xmlconfig and AppDomain.CurrentDomain.BaseDirectory. I obviously missed something and will revisit it at some point. The simple fix is to fully qualify the direcrtory and file paths in the sipsorcery-appsvr.exe.config file.
Regards,
Aaron
fixed. but new problem come up
Thanks. I changed xmlconfig to absolute path as following:
<add key="PersistenceConnStr" value="C:\Program Files\sipsorcery\xmlconfig" />
also added permission to folder C:\Program Files\sipsorcery\ for LocalService. It worked and the service can start. Just tested an outgoing call, and it works.
But there is one new error in error.log:
2010-03-09 11:01:28,770 [5] ERROR sipsorcery [(null)] - Exception SSHServerDaemon Start. ComponentActivator: could not instantiate NSsh.Server.NSshService
any idea?
<add key="PersistenceConnStr" value="C:\Program Files\sipsorcery\xmlconfig" />
also added permission to folder C:\Program Files\sipsorcery\ for LocalService. It worked and the service can start. Just tested an outgoing call, and it works.
But there is one new error in error.log:
2010-03-09 11:01:28,770 [5] ERROR sipsorcery [(null)] - Exception SSHServerDaemon Start. ComponentActivator: could not instantiate NSsh.Server.NSshService
any idea?
I haven't seen that error before. It would be worth checking in your add/remove programs that you have .Net 3.5 Service pack 1.
Are you planning on using the SSH access to your local sipsorcery instance? If not you can comment out the nssh node in your confiug file which will disable it and remove the error message.
Regards,
Aaron
Are you planning on using the SSH access to your local sipsorcery instance? If not you can comment out the nssh node in your confiug file which will disable it and remove the error message.
Regards,
Aaron
It already tried that, did not work
Actually I tried that before I posted, it did not work.