diff --git a/app/active_calls/resources/service/freebsd.service b/app/active_calls/resources/service/freebsd.service index d1e3404b7..6d5f952aa 100644 --- a/app/active_calls/resources/service/freebsd.service +++ b/app/active_calls/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/active_calls/resources/service/active_calls # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" active_calls_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/active_conferences/resources/service/freebsd.service b/app/active_conferences/resources/service/freebsd.service index 3c095846f..fef92caff 100644 --- a/app/active_conferences/resources/service/freebsd.service +++ b/app/active_conferences/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/active_conferences/resources/service/active # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" active_conferences_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/email_queue/resources/service/freebsd.service b/app/email_queue/resources/service/freebsd.service index 388e97a98..c6ccfed32 100644 --- a/app/email_queue/resources/service/freebsd.service +++ b/app/email_queue/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/email_queue/resources/service/email_queue.p # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" email_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/event_guard/resources/service/freebsd.service b/app/event_guard/resources/service/freebsd.service index 753fb7101..69e73d5bc 100644 --- a/app/event_guard/resources/service/freebsd.service +++ b/app/event_guard/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/event_guard/resources/service/event_guard.p # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" event_guard_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/fax_queue/resources/service/freebsd.service b/app/fax_queue/resources/service/freebsd.service index 16c8e6224..f8fa541ca 100644 --- a/app/fax_queue/resources/service/freebsd.service +++ b/app/fax_queue/resources/service/freebsd.service @@ -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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/operator_panel/resources/service/freebsd.service b/app/operator_panel/resources/service/freebsd.service index b33968f45..36cd2a7c2 100644 --- a/app/operator_panel/resources/service/freebsd.service +++ b/app/operator_panel/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/operator_panel/resources/service/operator_p # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" operator_panel_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/system/resources/service/freebsd.service b/app/system/resources/service/freebsd.service index 5c6db60c6..0ae37e51c 100644 --- a/app/system/resources/service/freebsd.service +++ b/app/system/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/system/resources/service/system_status.php" # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" system_status_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/app/xml_cdr/resources/service/freebsd.service b/app/xml_cdr/resources/service/freebsd.service index 6913fafd4..8675c82bd 100644 --- a/app/xml_cdr/resources/service/freebsd.service +++ b/app/xml_cdr/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/xml_cdr/resources/service/xml_cdr.php" # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" xml_cdr_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi diff --git a/core/websockets/resources/service/freebsd.service b/core/websockets/resources/service/freebsd.service index 54a6caef2..940a043ae 100644 --- a/core/websockets/resources/service/freebsd.service +++ b/core/websockets/resources/service/freebsd.service @@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/websockets/resources/service/websockets.php # Command to run the script command="/usr/local/bin/php" -command_args="$script > /dev/null 2>&1" websockets_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 2>&1 & echo $! > "$pidfile" echo "$name started." fi