PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Linux Launching another pxplus daemon task  (Read 280 times)

JR

  • New Member
  • *
  • Posts: 4
    • View Profile
Linux Launching another pxplus daemon task
« on: May 20, 2020, 11:11:23 AM »
Hi,
When launching my pxplus ATHENA daemon with command :
A=SYS("cd $home;export TERM=IO;"+ARG(0)+" ATHENA >/dev/null 2>/dev/null &")
and if I exit the current task, the ATHENA child is stopped.

But if i do it manually :
A=SYS("bash")
and
me@server:/tmp/pvx$ cd $home;export TERM=IO;/home/pxplus/pxplus ATHENA >/dev/null 2>/dev/null &
the ATHENA daemon still runs when I exit current ubuntu session.
I do not want the daemon to stop.
Any idea ?

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3368
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Linux Launching another pxplus daemon task
« Reply #1 on: May 20, 2020, 11:46:27 AM »
When you exit the parent task are you exiting the Linux session back to logon?  If so then you need to add 'nohup' or 'setsid' in front of pathname of the Executable (arg0) that you are running.  This prevents the SIGHUP from being sent to the child processes.

JR

  • New Member
  • *
  • Posts: 4
    • View Profile
Re: Linux Launching another pxplus daemon task
« Reply #2 on: May 21, 2020, 04:04:27 AM »
Hi,
Thanks. Unfortunately on my Ubuntu, adding nohup or setsid is no help. Logging out kills the child anyway for unknown reason.
I finally ended getting around the problem with "at" unix command.

A=SYS("at now -f /tmp/pvx/cmd")

and the cmd file containing :

cd $home;export TERM=IO;/home/pxplus/pxplus ATHENA >/dev/null

My problem is solved.