Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis forum Omnis running as a Windows Service

  • Omnis running as a Windows Service

    Posted by David Jepson on June 18, 2022 at 12:10 pm

    Hi, I’ve had decades of Omnis programming experience, but for the first time I am trying to run the Omnis App Server as a Windows Service. I do all my developing on a Mac, and I’m not very fluent in Windows. We are hoping to be able to start the App Server and the Library file automatically through the Windows Service interface (i.e., we don’t want to have to Open the Library manually every time we start the App Server). We are using the 64-bit version of the Omnis App Server. Should we try editing the ntserv.ini configuration file? If so, what would you suggest it look like? Thanks!

    David Jepson replied 2 weeks ago 4 Members · 6 Replies
  • 6 Replies
  • Klaus Schrödl

    Administrator
    June 18, 2022 at 8:11 pm

    David,

    running the Omnis App Server as as Windows service is really working very well.

    Put your library in the Omnis Startup folder and that’s it. Maybe you have to adapt the code to this a little or you just put a loader library in the startup folder, that is loading the main library in it’s usual environment.
    The default ntserv.ini file looks like this:

    [Service]
    Name=OMNISServerx64
    DisplayName=OMNIS Server x64
    Description=Omnis Web App Server x64
    Program=OMNIS.EXE
    StartType=2

    The Name entry determines the internal name of the service and you can give it the name of your application. But it shouldn’t contain any spaces, special character etc. Also it should be in lower case.
    It is used i.e. for starting/stopping the service via command line:

    net start myservice

    The display name is what appears in the Windows Service panel and may be your application’s full name with spaces, upper and lower case etc. But as short as possible.

    The description also appears in the Service panel and may contain some more words but not too many.

    The Program entry should not be changed as long as you don’t rename omnis.exe (and the depending DLLs)
    StartType means, if the service is startet manually, automatically (2) or if it is deactivated.

    What is really important, is the User Account the service is running under. The account must have the “Run as Service” user pivilege AND should have all necessary rights for executing the particular tasks of your application.
    Running the service at administrator level is not a good idea and may do real harm if your library may contain some bugs (= destructive code). Usually in business environments, a specific service account will be created that is given all the rights to resources as file shares, databases, network access etc. that is effectively needed.

    Cheers
    Klaus

    • David Jepson

      Member
      June 19, 2022 at 3:38 pm

      Thanks very much, Klaus, for your patient and comprehensive explanation. I’ll try to follow your suggestions!

      Cheers,

      David

  • Paul Mulroney

    Member
    June 20, 2022 at 1:44 am

    If you run the service as a particular user, then there are files stored in the users App Data folder – this is important when you want to run software updates etc.

    Also keep in mind that mapped drives are tied to a particular user – if you reference files on mapped drives, you must be running as a user that has access to those drives.

    • David Jepson

      Member
      June 21, 2022 at 8:07 am

      Thanks very much, Paul. Good to know.

      Cheers,

      David

  • Rocco

    Member
    June 20, 2022 at 1:54 pm

    I use RESKIT software provided by Microsoft itself.

    It is formed by two .exe and a little file of documentation:

    instsrv.exe

    srvany.exe

    Bye

    Rocco

    • David Jepson

      Member
      June 21, 2022 at 8:07 am

      Thanks Rocco, I’ll pass that idea on to my IT manager.

      Cheers,

      David

Log in to reply.