Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: How to use (phservice.exe) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GSOUZA
Groupie
Groupie
Avatar

Joined: October 20 2006
Location: Brazil
Online Status: Offline
Posts: 75
Posted: June 27 2007 at 15:59 | IP Logged Quote GSOUZA

Hello Dave,

could you please give a little explanation on how to use phservice.exe?

thanks

Gustavo
Back to Top View GSOUZA's Profile Search for other posts by GSOUZA
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 27 2007 at 16:31 | IP Logged Quote dhoward

Absolutely!

Shut PowerHome down and make that the SDM and database are shutdown as well. Open a Command prompt window (run cmd.exe) and navigate to the PowerHome directory. Execute the following:

phservice -i

This will install the PowerHome service.

To uninstall, execute:

phservice -u

Once the PowerHome service is installed, right-click on My Computer and select "Manage". Go to "Services" under "Services and Applications". Scroll through the list until you find the "PowerHome" service.

Everything should be good to go as the default, but if you want to verify, right click the PowerHome service and select properties. On the general tab, you can change the startup type. The default is automatic. On the Log On tab, you should have "Log on as" set to "Local System account" and have checked "Allow service to interact with desktop". These are the defaults.

To start the PowerHome service going, just right-click and select "All-tasks" followed by "Start".

Now comes the important part. In all likelihood, PowerHome will have multiple errors starting such as unable to open sockets, COM ports, the Script Server, TTS, etc. This is because when you installed PowerHome, all of these activex controls were installed as the currently logged on user (it could have even be Admin). When PowerHome is run as a service, it is running as a special System account which cant see these activex controls.

No problem...just get past the errors and get PowerHome running as a service. With PowerHome running as a service, open the File menu and select "Register Activex". A moment later you'll see a window that the ActiveX controls were registered.

Back in the Services window, stop the PowerHome service and Start the PowerHome service. PowerHome should now launch as a service without errors. The Register ActiveX process should only have to be done this one time.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GSOUZA
Groupie
Groupie
Avatar

Joined: October 20 2006
Location: Brazil
Online Status: Offline
Posts: 75
Posted: June 27 2007 at 17:04 | IP Logged Quote GSOUZA

Amazing, :)

thanks for the instant reply.

Gustavo
Back to Top View GSOUZA's Profile Search for other posts by GSOUZA
 
GSOUZA
Groupie
Groupie
Avatar

Joined: October 20 2006
Location: Brazil
Online Status: Offline
Posts: 75
Posted: June 27 2007 at 17:17 | IP Logged Quote GSOUZA

Just one more thing,

Im using Remote Desktop to manage my server so powerhome wont show up when running as service.

is there any way to open powerhome with remote desktop?

thanks

Gustavo
Back to Top View GSOUZA's Profile Search for other posts by GSOUZA
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 28 2007 at 18:18 | IP Logged Quote dhoward

Gustavo,

Im not quite sure what you're asking here, but it sounds as if when you're running Remove Desktop, you cant see PowerHome running as a service (even though it should still show in the System tray).

In any case, another change made to PowerHome with this version is that if you just launch PowerHome, (say from a desktop icon), if PowerHome is already running, it'll just bring up the currently running instance of PowerHome (instead of the previous error message saying that PowerHome was already running).

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GSOUZA
Groupie
Groupie
Avatar

Joined: October 20 2006
Location: Brazil
Online Status: Offline
Posts: 75
Posted: June 28 2007 at 19:00 | IP Logged Quote GSOUZA

exactly, when in remote desktop, i cant see what is running on local desktop.

yes i tried it but it gives me the odbc screen.

Gustavo
Back to Top View GSOUZA's Profile Search for other posts by GSOUZA
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: June 28 2007 at 21:29 | IP Logged Quote wasdvd

The instructions were just right. After the initial start and the register ActiveX step, it is cruising along fine.

This is a big step.
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: June 28 2007 at 23:24 | IP Logged Quote wasdvd

Using R11 on my XP Pro, once the service is running using the instructions above, I am not able to shutdown or restart the PC unless I stop the service first.

Since I have stopped the service, I am able to restart the PC, but PH does not seem to restart automatically once the PC is restarted.

Please advise.
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 29 2007 at 23:20 | IP Logged Quote dhoward

Gustavo,

I will setup some tests on my end and see if there is anything that can be done. It appears that the RDP is creating a completely separate desktop that is incapable of detecting the currently running PowerHome service and instead of bringing it current, is trying to launch a new instance and this of course will give the ODBC error.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 29 2007 at 23:29 | IP Logged Quote dhoward

Wasdvd,

Correct...when PowerHome is running as a service, clicking on the Exit or close windows button will just minimize PowerHome. It's designed to only shutdown when the service shuts down.

Now, as long as the service startup type is "automatic", it should automatically start when you boot your PC even if the service was previously stopped (it does on my test machines anyways).

Another way to start and stop the PowerHome service is using the phservice.exe utility. In addition to the -i option to install, the -u option to uninstall, it also has a -k and -r option as well. -k kills a service and -r starts a service. To use this with PowerHome would look like:

phservice -k powerhome

and

phservice -r powerhome

What I have done is create a restart batch file that looks like:

phservice -k powerhome
shutdown -r -t 5

The first line stops the PowerHome service followed by a 5 second countdown before the PC shutdowns and restarts.

Let me know if this doesnt work for you.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: June 29 2007 at 23:54 | IP Logged Quote wasdvd

Thanks, I'll give it a try.

I think the service tried to restart today as I rebooted, but the PLC and SDm were confused, so it never succeeded.

I finally reset the PLC and started the SDM by haned to get going.

Rally great work and impressive response.
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
GSOUZA
Groupie
Groupie
Avatar

Joined: October 20 2006
Location: Brazil
Online Status: Offline
Posts: 75
Posted: June 30 2007 at 22:55 | IP Logged Quote GSOUZA

dhoward wrote:
Gustavo,

I will setup some tests on my end and see if there is anything that can be done. It appears that the RDP is creating a completely separate desktop that is incapable of detecting the currently running PowerHome service and instead of bringing it current, is trying to launch a new instance and this of course will give the ODBC error.

Dave.


yes Dave,

this is exactly the problem I have.

thanks

Gustavo
Back to Top View GSOUZA's Profile Search for other posts by GSOUZA
 
bhlonewolf
Senior Member
Senior Member


Joined: March 29 2007
Online Status: Offline
Posts: 198
Posted: July 01 2007 at 21:42 | IP Logged Quote bhlonewolf

Unfortunately, this behavior is by design (the OS, that is). (Actually, it's a good thing for security, bad for what we'd like to see here.)

A somewhat-workaround is to connect to the server via remote desktop using the /console switch. Because the console session shares the same session space as services, you can interact with them.

The restart issue is still there ... this one is kind of a bummer if you have a system that restarts for other events.

Going forward, though, this will not work in Vista/Longhorn: services are now in session 0, and the console session has been moved to session 1 to eliminate security holes and, frankly, it's just a better design.

Dave -- I know this is not an easy fix given the platform limitations, but it's a biggie. :)
Back to Top View bhlonewolf's Profile Search for other posts by bhlonewolf
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: July 02 2007 at 09:42 | IP Logged Quote dhoward

I figured it would be tough . However, the plans are to separate the GUI client from the backend service so that there will be no need to directly connect to the service. Hopefully I can get there one day soon, but it's a pretty big task. Im taking it a piece at a time especially with the remote clients.

Kind of a bummer though that it won't work how it currently is...

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
guerrand
Senior Member
Senior Member
Avatar

Joined: December 18 2005
Location: United States
Online Status: Offline
Posts: 106
Posted: July 02 2007 at 16:38 | IP Logged Quote guerrand

dhoward wrote:
I figured it would be tough . However, the plans are to separate the GUI client from the backend service so that there will be no need to directly connect to the service. Hopefully I can get there one day soon, but it's a pretty big task. Im taking it a piece at a time especially with the remote clients.

Kind of a bummer though that it won't work how it currently is...

Dave.


Don't sweat it Dave. We all know you'll get it there eventually. So far the service is working like a charm for me.

__________________
VuMe
Back to Top View guerrand's Profile Search for other posts by guerrand Visit guerrand's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: November 04 2007 at 22:07 | IP Logged Quote mustangcoupe

Dave,

As I posted earlier in the week I am moving my ph install to a whs box essentially windows sbs2003 without some fluff. Now I need to address the service issue... I find that if I reboot the icon does not appear in the task bar (I do not have my PLC installed yet so I can not confirm if it is working or not at this point.) I find I have to do a phservice.exe -k powerhome phservice.exe -r powerhome to get it to show up.


__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 04 2007 at 22:40 | IP Logged Quote dhoward

Todd,

Ive seen this happen as well, although not consistently. Ive got one machine that this never happens on, and another where it always happens. Even though the icon does not show up in the tray, if you go into the task manager, PowerHome is indeed running and I can verify this by hitting it's webserver. Im going to try to get this worked out so it doesnt happen. In the meantime, rather than doing the phservice.exe -k, I just go to the task manager and kill the pwrhome.exe process. Within a minute, the phservice.exe process will relaunch the pwrhome.exe process and then the icon will show.

I'll keep you posted on what I find out with this.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: November 05 2007 at 17:28 | IP Logged Quote mustangcoupe

so it isnt me... what I have currently done is to create a bat file using pstools pskill.exe and kill the process and restart it when I log in. I will confirm that I see the web interface once I get everything set up.

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: November 19 2007 at 16:34 | IP Logged Quote jeffw_00

If I'm always logged into to my XP machine (one account, Admin privs, always logged in, logs in automatically on boot), is there any advantage to running PH as a service?

/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: November 19 2007 at 17:17 | IP Logged Quote wasdvd

For me, running XP-Pro always on, the service has been much more stable. I can't remember when Power-Home has gotten balled up and had to be restarted or the PLC reloaded.

The service also restarts each time the PC is rebooted - such as when MS decides you really must accept one of their security updates in the middle of the night.

I do reinitialize at 1:30AM each night, but I am not sure if even that is needed any more.

My big applause for Power-Home and Dave!!

Edited by wasdvd - November 19 2007 at 17:18
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 

Page of 2 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum