LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Process as a Window's Service

Is there any benefit in terms of stability or performance running LabVIEW processes as a Window’s service as opposed to simply running them as an application? I have been asked this question and I can’t think of any advantage in terms of performance or stability. I realize that if you are running a server it helps to have the core server running as a service since it will always be running and there is no need to start an application after a reboot. Are there any other advantages?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 1 of 4
(4,008 Views)

The best reason I have found for creating a service is the added security.  The service can run with elevated priviliges so no need for the dreaded 'Run as Administrator' application.  Plus you can prevent the user from simply whacking your application in the Task Manager.

 

I don't know of any implicit performance or stability boost so those would not be my top reasons.  

 

 

0 Kudos
Message 2 of 4
(3,984 Views)

@Darin.K wrote:

The best reason I have found for creating a service is the added security.


Added security? I would argue having LV run as a service (and therefore have SYSTEM level privileges) is less secure as you're opening up a potential vulnerability on the machine (e.g. replacing/controlling your application to do harm/damage).

 

The main reasons for running as a service are:

- Can run a process as soon as the PC boots up, before a user has logged on and even if switching users

- Can bypass UAC/permissions problems

 

Downsides:

- Requires a separate user-mode UI application to interface with the service (since it has no UI).

- Running as a service is not natively supported by LV - you need to do some legwork to make it run/shut-down properly as a service (e.g. srvstart)

 

Stability/performance wise - well if your application pops up a dialogue of any sort which suspends execution (e.g. modal dialogue, error window) then it will become unresponsive as you can't get to the UI to close it. In terms of actually executing your code, there won't be any difference, I believe it still renders the UI (just in a hidden session), of course, your UI would probably just be a blank front panel.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(3,934 Views)

@Sam_Sharp wrote:

@Darin.K wrote:

The best reason I have found for creating a service is the added security.


Added security? I would argue having LV run as a service (and therefore have SYSTEM level privileges) is less secure as you're opening up a potential vulnerability on the machine (e.g. replacing/controlling your application to do harm/damage).

 

I don't even know what running LV as a service means.  If I need to provide access to some hardware/file or whatever that requires elevated privileges I am going to do that via an application (written in  LV or whatever) which exposes that to unprivileged users via IPC.  The alternatives of Run as Administrator or giving users admin access are far less secure.  Likewise if I have something running which I do not want users to to stop either accidentally or maliciously I can also run it with elevated privileges and prevent that.  

0 Kudos
Message 4 of 4
(3,912 Views)