Fully detach from parent shell to prevent 'service' from blocking

This commit is contained in:
FusionPBX
2026-05-12 06:40:25 +00:00
committed by GitHub
parent ed241110ab
commit fa5ae89827
9 changed files with 18 additions and 18 deletions
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/fax_queue/resources/service/fax_queue.php"
# Command to run the script
command="/usr/local/bin/php"
command_args="$script > /dev/null 2>&1"
fax_queue_start() {
echo "Starting $name..."
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
echo "$name is already running."
else
$command $command_args &
# Fully detach from parent shell to prevent 'service' from blocking
nohup $command $script </dev/null >/dev/null 2>&1 &
echo $! > "$pidfile"
echo "$name started."
fi