Fully detach from parent shell to prevent 'service' from blocking
This commit is contained in:
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/active_calls/resources/service/active_calls
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
active_calls_start() {
|
active_calls_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/active_conferences/resources/service/active
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
active_conferences_start() {
|
active_conferences_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/email_queue/resources/service/email_queue.p
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
email_queue_start() {
|
email_queue_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/event_guard/resources/service/event_guard.p
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
event_guard_start() {
|
event_guard_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/fax_queue/resources/service/fax_queue.php"
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
fax_queue_start() {
|
fax_queue_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/operator_panel/resources/service/operator_p
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
operator_panel_start() {
|
operator_panel_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/system/resources/service/system_status.php"
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
system_status_start() {
|
system_status_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/xml_cdr/resources/service/xml_cdr.php"
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
xml_cdr_start() {
|
xml_cdr_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ script="/usr/local/www/fusionpbx/app/websockets/resources/service/websockets.php
|
|||||||
|
|
||||||
# Command to run the script
|
# Command to run the script
|
||||||
command="/usr/local/bin/php"
|
command="/usr/local/bin/php"
|
||||||
command_args="$script > /dev/null 2>&1"
|
|
||||||
|
|
||||||
websockets_start() {
|
websockets_start() {
|
||||||
echo "Starting $name..."
|
echo "Starting $name..."
|
||||||
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
if [ -f "$pidfile" ] && kill -0 "$(cat $pidfile)" 2>/dev/null; then
|
||||||
echo "$name is already running."
|
echo "$name is already running."
|
||||||
else
|
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 $! > "$pidfile"
|
||||||
echo "$name started."
|
echo "$name started."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user