NetTalk Central

Author Topic: Reboot from Running NT Application  (Read 3116 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 394
    • View Profile
    • Email
Reboot from Running NT Application
« on: July 05, 2024, 08:15:44 PM »
Hello,
I have the need to reboot a running NT app on a virtual Server, ideally from a button's server side code.
The application is running as a service so will/ should  restart.
I have searched the WinEvent5 documentation for clues without success

I want to do this to refresh memory lost through leakage.
 
Thanks in anticipation...
Richard
NT 14.23

Alberto

  • Hero Member
  • *****
  • Posts: 1869
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Reboot from Running NT Application
« Reply #1 on: July 06, 2024, 08:46:06 AM »
Hi Richard I
I have memory leaks too
What Im doing is Halt(ed) it at midhight
-----------
Regards
Alberto

Richard I

  • Sr. Member
  • ****
  • Posts: 394
    • View Profile
    • Email
Re: Reboot from Running NT Application
« Reply #2 on: July 06, 2024, 06:36:12 PM »
Thanks Alberto
Im trying to prevent users needing to RDP onto the Amazon Virtual server
Hence the need to reboot from a running app
Not sure that Halt would work, because "Halt" is a shut down without a restart
Richard
« Last Edit: July 07, 2024, 08:21:06 PM by Richard I »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11232
    • View Profile
Re: Reboot from Running NT Application
« Reply #3 on: July 08, 2024, 06:31:14 PM »
Let's not use the phrase "reboot" since that implies a machine restart.

If it's a service you should use the RestartService method call (for the gSelfSelfservice object).
If it's an EXE see CHAIN, then HALT

Of course the better solution is to figure out why your code is leaking memory, and fix that. The server itself doesn't leak memory.

Richard I

  • Sr. Member
  • ****
  • Posts: 394
    • View Profile
    • Email
Re: Reboot from Running NT Application
« Reply #4 on: July 10, 2024, 01:30:17 AM »
Thanks Bruce,
I note your comment regarding terminology, but FYI the Amazon Console gives the option to "Reboot"  selected running EC2 Instances.
Research has told me that Microsoft Defender and its  antimalware subsidiary can cause memory leakage.
Eliminating them has proved difficult.
Cheers
Richard

 
« Last Edit: July 10, 2024, 01:39:58 AM by Richard I »

Jane

  • Sr. Member
  • ****
  • Posts: 368
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Reboot from Running NT Application
« Reply #5 on: July 10, 2024, 09:20:13 AM »
BTW, you can always reboot a Windows computer with the command line:

shutdown /r /f /t 0

(May need to run asAdministrator)

Type shutdown /? at a command prompt for other options.


Richard I

  • Sr. Member
  • ****
  • Posts: 394
    • View Profile
    • Email
Re: Reboot from Running NT Application
« Reply #6 on: July 10, 2024, 04:52:16 PM »
Thank you Jane,
very straight forward as always

I have taken on board Bruce's caution and will await his elucidation  before implementing.
Kind regards,

Richard

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11232
    • View Profile
Re: Reboot from Running NT Application
« Reply #7 on: July 10, 2024, 08:15:58 PM »
hey, if you want to reboot the machine, who am I to stop you...