Running UE as a service

Post Reply
Michaelm
Posts: 46
Joined: Sat Oct 18, 2003 6:02 pm
Location: Netherlands

Running UE as a service

Post by Michaelm »

I'm running Windows Home Server for a while now and I really like it.
It's based upon Windows Server 2003 and normally you just administer it remotely with the Windows Home Server Console or Remote Desktop.
So it's usually just waiting there at the login screen and running only services.

Therefore I would like to be able to run UE as a service.
Currently it just shuts down immediately :(
It would be extra great if the UI could just be brought up once I log in but I could manage that myself by stopping the service, starting UE, ending it and running the service again.

Could you please look into that and let me know if it feasible ?
Ustinov
Posts: 20
Joined: Tue Aug 12, 2003 6:41 pm

Post by Ustinov »

It is not free, but might this help?
http://run-exe-as-service.qarchive.org/
Michaelm
Posts: 46
Joined: Sat Oct 18, 2003 6:02 pm
Location: Netherlands

Post by Michaelm »

I have already tried some programs that promised the gui like that.
I can also start it as a service using srvany from the Windows 2003 Resource Kit.
Problem is that it starts fine as a service when I'm logged on to the desktop.
But when it should start on computer bootup it just fails to and exits immediately :(

Thanks for your answer though !
I appreciate you thinking with me.
Maccara
Posts: 35
Joined: Thu Nov 06, 2008 12:18 pm
Location: Finland

Post by Maccara »

Try http://www.firedaemon.com/ if you have not already.

It has extensive features to handle also software, which require interactive desktop to start properly.

Haven't tried myself, but I would be surprised if that couldn't get UE running as a service at boot with proper options.

Couple of caveats though:

1. UE is not designed to run as a service, and therefore when user logs off, UE will most likely stop too (however, firedaemon should have no problem in detecting this and restarting it in the backround again)

2. You may have problems with tray icons etc of UE (depending on if Alex has implemented tray icon handling correctly or not - many many software have this implemented "quickly" and you may lose the tray icons in many ways, including when run as service at boot).

3. It may be difficult to show the UE user interface after logon, but firedaemon has some options to alleviate this.
alex
Posts: 4543
Joined: Thu Feb 27, 2003 5:57 pm

Post by alex »

as to the tray icon you can disable it, uncheck edit menu->icon in system tray if it matters.

if it is not just a matter of recompilation, vast changes to convert it to a service could be problematic because of other pending work, i didn't check this particular issue closely.
Maccara
Posts: 35
Joined: Thu Nov 06, 2008 12:18 pm
Location: Finland

Post by Maccara »

Turning UE into a full-blown serviceable process would indeed take some work (main thing to consider would be to separate UI & core completely, so UI would only run on a user request and core as a service).

However, there are much simpler tasks to check to just make UE compatible with the myriad of 3rd party apps which can run arbitrary apps as a service:

Mainly, need to handle WM_QUERYENDSESSION and WM_ENDSESSION, so that UE doesn't unnecessarily shut down when user logs off (enabled via -service cmdline option, perhaps).

There probably isn't any need to actually disable tray-icon, (unless UE crashes due to it failing to bind when there's no interactive user). Moreso, UE should check if there is a systemtray to bind to and check periodically if there is a need to re-bind.

Those two considerations make most apps runnable as a service.

However, I have no interest in running UE as a service myself, so I haven't checked anything - those are just general requirements for an app to be runnable as a service. There may be other issues of course, depending on what the app expects from the running environment.
Michaelm
Posts: 46
Joined: Sat Oct 18, 2003 6:02 pm
Location: Netherlands

Post by Michaelm »

Thanks for all the replies guys !!

Actually it's not necessary for UE to become a full blown service.
Would be nice ofcourse but it's not the essence of my request.

I tried firedaemon and it behaves the same as srvany.
When I'm logged on to the desktop and try to start UE as a service using either srvany or firedaemon it start up and works perfectly.

But when the computer restarts and it should execute UE as a service both srvany and firedaemon fail.
I discovered this through the restart feature of firedaemon where it will just restart the executable if it's not responding.
In the event log I can see firedaemon trying to start UE and then a few seconds later there's the message that the process can't be found and tries to restart it again.
srvany just tries to start it once and then dies.

So there is something preventing UE to be run like this through these programs. I don't know what it is but I'm sure Alex has got a much better clue on this.

Whenever I want to see the UI I just stop the service. Then execute UE normally, do my managing like selecting posts to download and then quit UE again and start up the service again.
So it will just keep on downloading selected messages and getting the headers every 360 minutes like I've set it when it is being run as a service.

This is actually all I need.
A full blown service would indeed be nice but I reckon this will be major programming work.
Finding what prevents UE to be started without a desktop being present would be not that hard I guess.
Ofcourse UE should also keep running when the user logs off of the desktop.

I hope I made myself clear in what I need.
If not please ask :)
Maccara
Posts: 35
Joined: Thu Nov 06, 2008 12:18 pm
Location: Finland

Post by Maccara »

Michaelm wrote: When I'm logged on to the desktop and try to start UE as a service using either srvany or firedaemon it start up and works perfectly.

...


But when the computer restarts and it should execute UE as a service both srvany and firedaemon fail.

...

In the event log I can see firedaemon trying to start UE and then a few seconds later there's the message that the process can't be found and tries to restart it again.
Ah, there seems to be some dependency in UE that prevents it from starting up when interactive desktop is not available.

Did you try disabling UE "tray icon"? (it may crash if trying to bind in non-existent system tray)

If that does not help, Alex probably has some ideas and can do something about it.

Also, have you checked UE logs if they might indicate what went wrong?

My suspicion is that there simply is some UI dependent code which does not fail gracefully when desktop is not available and throws an exception which is not caught & handled. Most likely something trivial which Alex could circumvent.
Michaelm
Posts: 46
Joined: Sat Oct 18, 2003 6:02 pm
Location: Netherlands

Post by Michaelm »

Yes I did try disabling the UE tray icon.
I even disabled start minimized.
But nothing helps.
UE quits immediately when there's no desktop present.
Logs don't show any info.
They just show login and logout and no further info.
Post Reply