N
N
nick88hello2014-06-05 09:36:23
linux
nick88hello, 2014-06-05 09:36:23

How to make a process launched from bash not block other processes?

Fragment of my script:

#Запуск MySQL сервера
 /usr/sbin/mysqld
if [ $? != 0 ]; then
     error_handler "Could not start mysql server..."
fi

#Запуск php-fpm
/usr/sbin/php-fpm
if [ $? != 0 ]; then
      error_handler "Could not start php-fpm..."
fi

#Запуск nginx
/usr/local/nginx/sbin/nginx
if [ $? != 0 ]; then
      error_handler "Could not start nginx..."
fi

The whole problem is that after starting the MySQL server, the rest of the script stops executing. Is it possible to make MySQL run in, say, a separate thread?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey, 2014-06-05
@nick88hello

/usr/sbin/mysqld &
Didn't you just think to run it through init.d/invoke.d/services?

M
Mikhail Alekseev, 2014-06-05
@Fandorin

Try running
/etc/init.d/mysql start
/etc/init.d/php-fpm start
/etc/init.d/nginx start

E
Eugene Obrezkov, 2014-06-05
@ghaiklor

Start daemons via systemctl, not directly. For example:
sudo systemctl restart mysqld

N
nick88hello, 2014-06-05
@nick88hello

The thing is, I'm using Cygwin and there is no init.d/invoke.d/services . In addition,
I don’t always need a server, so I think it’s not rational to add it to startup.
And I'll try this:

/usr/sbin/mysqld&

L
larrabee, 2014-06-05
@larrabee

systemctl and does not add to autoload. This is if through chkconfig enable, then yes.

It can and systemctl.systemctl enable daemon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question