Recent

Author Topic: Restart and shutdown APIs for lazarus on Linux  (Read 7343 times)

vini7

  • New Member
  • *
  • Posts: 13
Restart and shutdown APIs for lazarus on Linux
« on: November 05, 2007, 09:19:52 am »
Hi
I am using UDP communication in my application.If program loses the communication with both control server and I/O server more that 1 day,then program will automatically reboot the system or application reboot the system if memory load goes above 65%.

For these reasons I want to use APIs for reboot the system or shutdwn the system So what shld I use in lazarus on Linux to accompolish these fetures.

Please help

Thanks & Regards
Vini7

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
RE: Restart and shutdown APIs for lazarus on Linux
« Reply #1 on: November 05, 2007, 11:31:56 am »
Linux is not Windows 95! There's no need to do this imho.
If your program has memory-leaks then try to fix them.

vini7

  • New Member
  • *
  • Posts: 13
Restart and shutdown APIs for lazarus on Linux
« Reply #2 on: November 05, 2007, 02:25:24 pm »
can u please tell me in detail why this is not reqiured on Linux....

any references or documentation do u have ....thus I will have clear idea of porting on linux from window system...


Please help


thanks  & regards

vini7

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Restart and shutdown APIs for lazarus on Linux
« Reply #3 on: November 05, 2007, 03:00:40 pm »
Can you tell me why this is required on Windows?
I can't see why a lost network connection is a reason to reboot the system.
Why do you think the reboot fixes any network problem?

Imho, an application should never reboot the system, except windows installers perhaps, but only after asking the user.

Regarding the memory load: Try to remove memleaks from you app,
or restart the application not the system.

bee

  • Sr. Member
  • ****
  • Posts: 365
Restart and shutdown APIs for lazarus on Linux
« Reply #4 on: November 06, 2007, 01:28:04 am »
It's the "Windows Effectâ„¢".  :lol:
-Bee-

A long time pascal lover.

vini7

  • New Member
  • *
  • Posts: 13
Restart and shutdown APIs for lazarus on Linux
« Reply #5 on: November 06, 2007, 11:42:29 am »
Ok I have understood it mostly and I am trying to resolve this but in connection with this issue........

please look into my new topic....

Almindor

  • Sr. Member
  • ****
  • Posts: 411
    • http://www.astarot.tk
Restart and shutdown APIs for lazarus on Linux
« Reply #6 on: November 06, 2007, 05:30:28 pm »
Windows 95 leaked itself, no need for apps.. that was the point, linux doesn't leak memory itself.

If your programs leaks memory then you should fix it. Compile it with -ghl, run let it run for a minute or so and then stop it normally. You should see a rather long output of where the leaks originate.