It's very simple. Create the shell script kill4d.sh:

#!/bin/bash

KILLSIGNAL=/path/to/writeable/directory/killsignal

while true
do
    if [[ -f "$KILLSIGNAL" ]]; then
        rm -f "$KILLSIGNAL"
        killall 4D
    fi

    sleep 1
done

Change KILLSIGNAL to point to a path within a directory that is writeable by 
PHP. You may have to chmod a directory within PHP's web root to allow this.

Then do:

   chmod +x kill4d.sh

The run it as whatever user launches 4D. All your PHP script has to do is:

   shell_exec('touch /path/to/writeable/directory/killsignal');

That should do it.

> I'll look into that. Our launchd process that keeps 4D alive uses a shell 
> script that wraps an applescript. PHP could call
> 
> shell_exec('osascript tryToKill4d.scpt'')
> 
> but I again my run into the problem where _www (the apache/php user) can't 
> run the script due to permissions.

Regards,

   Aparajita

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/

Reply via email to