Run service on Wine?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Run service on Wine?

Post by MichaelZ »

Is it possible to run Windows service on Wine? If it is, how do I start a service? I am running Wine on Fedora machine. Thanks.

Michael
Dan Kegel

Run service on Wine?

Post by Dan Kegel »

On Wed, Apr 30, 2008 at 7:05 AM, MichaelZ <[email protected]> wrote:
Is it possible to run Windows service on Wine?
Yes.
If it is, how do I start a service?
wine net start servicename

This only works in recent versions of Wine. Which version are you using?
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Post by MichaelZ »

I installed my service at c:\MyCompany\MyService.exe. And I try to run the service in Terminal window:
wine net start "c:\MyCompany\MyService.exe" I got the following error messages:
[maker@fc6-dev ~]$ wine net start "c:\MyCompany\MyService.exe"
fixme:advapi:RegisterEventSourceA ((null),"ImgLM"): stub
fixme:advapi:RegisterEventSourceW (L"",L"ImgLM"): stub
fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 300, std (d/m/y): 26/10/2008, dlt (d/m/y): 6/04/2008
Could not get handle to service.
The wine version is 0.9.60.
Thanks.

Michael
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

MichaelZ wrote:I installed my service at c:\MyCompany\MyService.exe. And I try to run the service in Terminal window:
wine net start "c:\MyCompany\MyService.exe" I got the following error messages:
[maker@fc6-dev ~]$ wine net start "c:\MyCompany\MyService.exe"
fixme:advapi:RegisterEventSourceA ((null),"ImgLM"): stub
fixme:advapi:RegisterEventSourceW (L"",L"ImgLM"): stub
fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 300, std (d/m/y): 26/10/2008, dlt (d/m/y): 6/04/2008
Could not get handle to service.
The wine version is 0.9.60.
Thanks.

Michael
LOL does that work in windows? No it doesn't! You have to properly install service into registry. Then you can use 'net start <service name>' command.
Also make sure you using new Wine version(s) (wine-0.9.60 or at least wine-0.9.58).
Dan Kegel

Run service on Wine?

Post by Dan Kegel »

On Wed, Apr 30, 2008 at 9:23 AM, MichaelZ <[email protected]> wrote:
I installed my service at c:\MyCompany\MyService.exe.
Did you also register your service?
Usually services can register themselves if you run them onces during
installation
with the right commandline option, e.g. /register, but it depends
on how you wrote it.
And I try to run the service in Terminal window:
wine net start "c:\MyCompany\MyService.exe" I got the following error messages:
That's not how one usually starts services, is it?
Try starting it on Windows like that, bet it won't work.
You need to do
net start servicename
where servicename is whatever your service was registered under in the registry.
- Dan
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Post by MichaelZ »

Thanks for the reply. I have checked registry settings and they seemed to be correct, and Start setting is set to 2 (Automatic). The service is started up once I open Registry Editor from Terminal window, but once I shut down Registry Editor, the service is also shut down. Here are the messages after I shut down Registry Editor:
[root@fc6-dev ~]# regedit
fixme:advapi:RegisterEventSourceA ((null),"ImgLM"): stub
fixme:advapi:RegisterEventSourceW (L"",L"ImgLM"): stub
I use wine 0.9.60 by the way.
Any ideas? Thanks.

Michael
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

MichaelZ wrote:Thanks for the reply. I have checked registry settings and they seemed to be correct, and Start setting is set to 2 (Automatic). The service is started up once I open Registry Editor from Terminal window, but once I shut down Registry Editor, the service is also shut down.
That's by design. Wine kills all services and drivers when all programs exited. Or at least it should do that.

You can not just run a service by itself. It wasn't ever an intention to have some parts of Wine to run unattended. Not yet at least.
Dan Kegel

Run service on Wine?

Post by Dan Kegel »

On Wed, Apr 30, 2008 at 11:08 AM, MichaelZ <[email protected]> wrote:
[root@fc6-dev ~]# regedit
Please don't run wine as root.
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Post by MichaelZ »

OK, but I need to run a service on Linux machine even without any Wine application running. Because the service allows client machine to access it from different machines. If this feature is by design, I think this should be changed as in my case I only want the service running on Linux machine.
Thanks.

Michael
Dan Kegel

Run service on Wine?

Post by Dan Kegel »

On Wed, Apr 30, 2008 at 12:17 PM, MichaelZ <[email protected]> wrote:
OK, but I need to run a service on Linux machine even without any Wine
application running. Because the service allows client machine to access
it from different machines.
That should be fine.
If this feature is by design, I think this should be changed as in my case I only want the service running on Linux machine.
What feature are you talking about?

You should be able to run the service as a normal user even
when nobody is logged in. You may need to provide a
dummy X server to make Wine happy, as it seems to
have trouble running without X these days (grrr).

You might have to tell us a bit more about your service
for us to advise you correctly...
- Dan
DARKGuy
Level 2
Level 2
Posts: 35
Joined: Mon Mar 31, 2008 8:16 pm

Run service on Wine?

Post by DARKGuy »

My guess is that he's trying to run a Windows service inside WINE
(duh!) but thinking about it the Windows way. I don't think he knows
how to do that, Dan, or else he could've made a random user or
something that will start such service in a dummy X server and be
happy with it.

On Wed, Apr 30, 2008 at 2:51 PM, Dan Kegel <[email protected]> wrote:
On Wed, Apr 30, 2008 at 12:17 PM, MichaelZ <[email protected]> wrote:
OK, but I need to run a service on Linux machine even without any Wine
application running. Because the service allows client machine to access
it from different machines.
That should be fine.

If this feature is by design, I think this should be changed as in my case I only want the service running on Linux machine.
What feature are you talking about?

You should be able to run the service as a normal user even
when nobody is logged in. You may need to provide a
dummy X server to make Wine happy, as it seems to
have trouble running without X these days (grrr).

You might have to tell us a bit more about your service
for us to advise you correctly...
- Dan
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Post by MichaelZ »

This is the feature I was talking about:
"That's by design. Wine kills all services and drivers when all programs exited. Or at least it should do that.

You can not just run a service by itself. It wasn't ever an intention to have some parts of Wine to run unattended. Not yet at least."
Dan Kegel

Run service on Wine?

Post by Dan Kegel »

On Wed, Apr 30, 2008 at 12:54 PM, MichaelZ <[email protected]> wrote:
This is the feature I was talking about:

"That's by design. Wine kills all services and drivers when all programs exited. Or at least it should do that.
You can not just run a service by itself. It wasn't ever an intention to have some parts of Wine to run unattended. Not yet at least."
You can get around this by running any normal
app, say, Notepad. That will keep the services alive.
- Dan
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Re: Run service on Wine?

Post by MichaelZ »

DARKGuy wrote:My guess is that he's trying to run a Windows service inside WINE
(duh!) but thinking about it the Windows way. I don't think he knows
how to do that, Dan, or else he could've made a random user or
something that will start such service in a dummy X server and be
happy with it.
Ok, I don't know how to do that. Would you tell me how? Thanks.
DARKGuy
Level 2
Level 2
Posts: 35
Joined: Mon Mar 31, 2008 8:16 pm

Run service on Wine?

Post by DARKGuy »

I would be glad to, but I'm at work under Windows and I don't have any
idea on setting up a dummy X server. However, you can create an user
using your distribution's user management tools, or the 'adduser'
script =).

On Wed, Apr 30, 2008 at 3:56 PM, MichaelZ <[email protected]> wrote:
DARKGuy wrote:
My guess is that he's trying to run a Windows service inside WINE
(duh!) but thinking about it the Windows way. I don't think he knows
how to do that, Dan, or else he could've made a random user or
something that will start such service in a dummy X server and be
happy with it.
Ok, I don't know how to do that. Would you tell me how? Thanks.




vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Run service on Wine?

Post by vitamin »

MichaelZ wrote: Ok, I don't know how to do that. Would you tell me how? Thanks.
Start a notepad, then start your services. And don't close notepad. That's all you can do now.
Paul Johnson

Run service on Wine?

Post by Paul Johnson »

On Wednesday 30 April 2008 11:08:37 am MichaelZ wrote:
[root@fc6-dev ~]# regedit
fixme:advapi:RegisterEventSourceA ((null),"ImgLM"): stub
fixme:advapi:RegisterEventSourceW (L"",L"ImgLM"): stub

Any ideas? Thanks.
Not sure about your initial problem, but I do know that you have created
permissions problems on your ~/.wine by running as root. You should never
log in as root if your normal username works, and you should never use root
unless you have a clear reason to do so, and even then, only for the task
that needs such permissions (such as installing or removing packages, adding
or deleting users, inserting or removing kernel modules and other tasks of an
administrative or emergency recovery nature). Running with elevated
privleges when you don't need them is a great way to complicate your life as
a user on any platform in a great number of ways, almost all of which are
beyond the scope of this list.

If you hosed the permissions on your ~/.wine, you'll need to
# chown -R user:user ~/.wine
(replace user with your username) to get it back the way it should be.

Wine assumes you meant to have "administrator" privleges in "Windows." This
shouldn't be a problem as far as Windows malware affecting your system beyond
~/.wine is concerned, as long as you're running wine as a normal,
not-root-privleged user.

--
Paul Johnson
[email protected]

Explaination of .pgp part: http://linuxmafia.com/faq/Mail/rant-gpg.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.winehq.org/pipermail/wine-us ... chment.pgp
Paul Johnson

Run service on Wine?

Post by Paul Johnson »

On Wednesday 30 April 2008 12:17:26 pm MichaelZ wrote:
OK, but I need to run a service on Linux machine even without any Wine
application running. Because the service allows client machine to access it
from different machines. If this feature is by design, I think this should
be changed as in my case I only want the service running on Linux machine.
Thanks.
What is the service you're trying to run? It sounds like you're trying to use
some Windows program to provide remote access to that machine. Don't be too
surprised if it turns out you can only interact with programs running inside
the Wine environment if that's the case.

--
Paul Johnson
[email protected]

Explaination of .pgp part: http://linuxmafia.com/faq/Mail/rant-gpg.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.winehq.org/pipermail/wine-us ... chment.pgp
MichaelZ
Level 2
Level 2
Posts: 16
Joined: Tue Apr 22, 2008 1:50 pm

Post by MichaelZ »

Thank you all for the help. My initial problem is that after I install the service, it does not run. And the reason is that by design, if no Wine application is running, then all services are killed. If I start notepad first, then install my service, the service is running and working just fine.
It would be better if I don't have to run another Wine application for my service to start, but that is what I have to do now. I hope this would change in the future.
Regards,


Michael
Locked