Home Help Center

Running icestorm as a windows service

HomerSHomerS Member Naveed GhoriOrganization: L-3 Communications NautronixProject: Maratime Monitoring
Hi,

I have been trying to run icesotrm (via icebox.exe) as a windows service unsuccessfully. I get the 1053 error from the windows service. No icegrid is involved. No inhouse code in involved just the binaries from ZeroC.

The command uses a single configure file with IceBox.InheritProperties=1 (as the working directory for a windows service is the windows/system32 directory)

The service works fine in a command prompt. I have tried different account to run the service including LocalService/System/My own personal account.

If I run with a bad config file the 1053 error on service start happens instantaneously whereas if I have a good config file it takes about 30 seconds to timeout.

I cannot see any errors in the Events log (system or application).

Is icebox able to run icestorm service as a standalone windows service?

Ice 3.4.2
Windwos 7 32 bit

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Naveed,

    Welcome to our forums. We provide step-by-step instructions for installing an Ice service as a Windows service in the manual: Manually Installing a Service - Ice 3.4 - ZeroC

    Can you try to follow these steps with IceStorm? The executable for IceStorm is icebox.exe, and you also need a "data" directory.
    The command uses a single configure file with IceBox.InheritProperties=1 (as the working directory for a windows service is the windows/system32 directory)

    Actually, you don't need to use IceBox.InheritProperties. Your IceStorm service can (and should) have its own config file with its own properties.

    Just be careful with permissions: you'll typically create files and directories as yourself, but the service runs as LocalService, so make sure LocalService can read the config file(s) and write to the data directory.

    Please let me know how this goes!

    Best regards,
    Bernard
  • HomerSHomerS Member Naveed GhoriOrganization: L-3 Communications NautronixProject: Maratime Monitoring
    Hi, Thanks bernard for the quick response.

    I had tired many things (including the manual service install) and am at a point of just getting things working before setting it up properly.

    SO i had setup icestorm in transient mode so no "data directory" is required unless there is some other directory needed. Icepatch has the property "IcePatch2.Directory" but i could not find and icebox/icestorm equivalent.

    I will give it another try however using full paths and directory permissions setup as per the manual service setup.
  • HomerSHomerS Member Naveed GhoriOrganization: L-3 Communications NautronixProject: Maratime Monitoring
    Still no luck..
    Anyway here are my config files (which work in cmd line box)
    Icebox and iceStorm Configs are blow
    IceStorm.Directory=C:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data
    IceBox.ServiceManager.Endpoints=tcp -p 0
    IceBox.Service.IceStorm=IceStormService,34:createIceStorm --Ice.Config="C:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config_storm"
    
    IceStorm.InstanceName=IceStorm
    IceStorm.TopicManager.Endpoints=tcp -p 17614
    IceStorm.Publish.Endpoints=tcp -p 0:udp -p 0
    IceStorm.Trace.TopicManager=2
    IceStorm.Trace.Topic=1
    IceStorm.Trace.Subscriber=1
    IceStorm.Flush.Timeout=2000
    IceStorm.Transient=1
    

    The LocalService has full access the the directory in question.

    I have tried different format fo the service bin path but all give the windows services 1053 error after the timeout:
    c:\Program Files\ZeroC\Ice-3.4.2\bin\icebox.exe --Ice.Config=c:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config
    "c:\Program Files\ZeroC\Ice-3.4.2\bin\icebox.exe" --Ice.Config="c:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config"
    c:\Program Files\ZeroC\Ice-3.4.2\bin\icebox.exe --Ice.Config="c:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config"
    c:\Program Files\ZeroC\Ice-3.4.2\bin\icebox.exe --Ice.Config=c:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config
    
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Naveed,

    Can you post your sc create command?

    In particular, make sure you pass "--service <servicename>", like in the icepatch2 example.

    Best regards,
    Bernard
  • HomerSHomerS Member Naveed GhoriOrganization: L-3 Communications NautronixProject: Maratime Monitoring
    Success!

    Thanks for all your help. I had missed the --service parameter. I had tired it previously but it had failed previously probably due to permissions.

    Thanks for all your help and ultra fast response.

    The sc command that i used eventually for reference was:
    C:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data>sc create Test9 binpath= "c:\Program Files\ZeroC\Ice-3.4.2\bin\icebox.exe --Ice.Config=\"c:\Windows\ServiceProfiles\LocalService\AppData\Local\icebox\data\icebox.config\" --service Test9" obj= "NT Authority\LocalService" password= ""
    

    Naveed
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Great!

    Now, you can optimize your configuration file:
      you don't need the IceStorm.Directory in your IceBox config file
      in general I would not use "-p 0" in endpoints ... just don't specify a port, and the OS will pick an ephemeral port
      "IceBox.ServiceManager.Endpoints=tcp -p 0" or "IceBox.ServiceManager.Endpoints=tcp" is not particularly usable, as you don't know the port and as a result won't be able to reach this IceBox service manager. It's also listening on all your network interfaces, which could be a security risk. If you don't need the Service Manager, the simplest is leave this property unset
      in IceStorm.Publish.Endpoints=tcp -p 0:udp -p 0, it's likely you don't want to publish with UDP and therefore should remove the udp endpoint

    Best regards,
    Bernard
  • HomerSHomerS Member Naveed GhoriOrganization: L-3 Communications NautronixProject: Maratime Monitoring
    Thanks for the tips.
    I am assuming that there is no way to set the working directory so I have to use full paths. (The installer would be easier with relative paths).
Sign In or Register to comment.