170525 17:56:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170525 17:56:18 [Note] /usr/sbin/mysqld (mysqld 5.5.56-MariaDB) starting as process 2781 ...
170525 17:56:18 InnoDB: The InnoDB memory heap is disabled
170525 17:56:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170525 17:56:18 InnoDB: Compressed tables use zlib 1.2.7
170525 17:56:18 InnoDB: Using Linux native AIO
170525 17:56:18 InnoDB: Initializing buffer pool, size = 32.0M
170525 17:56:18 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
170525 17:56:18 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
170525 17:56:18 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 64 MB
InnoDB: Database physically writes the file full: wait...
170525 17:56:19 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 64 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
170525 17:56:19 InnoDB: Waiting for the background threads to start
170525 17:56:20 Percona XtraDB (http://www.percona.com) 5.5.52-MariaDB-38.3 started; log sequence number 0
170525 17:56:20 [Note] Plugin 'FEEDBACK' is disabled.
170525 17:56:20 [Note] Server socket created on IP: '0.0.0.0'.
170525 17:56:20 [Warning] 'user' entry 'root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:20 [Warning] 'user' entry '@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:20 [Warning] 'proxies_priv' entry '@ root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:20 [Note] Event Scheduler: Loaded 0 events
170525 17:56:20 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.56-MariaDB' socket: '/var/lib/mysqld/mysqld.sock' port: 3306 MariaDB Server
170525 17:56:34 [Note] /usr/sbin/mysqld: Normal shutdown
170525 17:56:34 [Note] Event Scheduler: Purging the queue. 0 events
170525 17:56:34 InnoDB: Starting shutdown...
170525 17:56:39 InnoDB: Shutdown completed; log sequence number 1597945
170525 17:56:39 [Note] /usr/sbin/mysqld: Shutdown complete
170525 17:56:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170525 17:56:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170525 17:56:39 [Note] /usr/sbin/mysqld (mysqld 5.5.56-MariaDB) starting as process 4213 ...
170525 17:56:39 InnoDB: The InnoDB memory heap is disabled
170525 17:56:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170525 17:56:39 InnoDB: Compressed tables use zlib 1.2.7
170525 17:56:39 InnoDB: Using Linux native AIO
170525 17:56:39 InnoDB: Initializing buffer pool, size = 32.0M
170525 17:56:39 InnoDB: Completed initialization of buffer pool
170525 17:56:39 InnoDB: highest supported file format is Barracuda.
170525 17:56:40 InnoDB: Waiting for the background threads to start
170525 17:56:41 Percona XtraDB (http://www.percona.com) 5.5.52-MariaDB-38.3 started; log sequence number 1597945
170525 17:56:41 [Note] Plugin 'FEEDBACK' is disabled.
170525 17:56:41 [Note] Server socket created on IP: '0.0.0.0'.
170525 17:56:41 [Warning] 'user' entry 'root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:41 [Warning] 'user' entry '@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:41 [Warning] 'proxies_priv' entry '@ root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:41 [Note] Event Scheduler: Loaded 0 events
170525 17:56:41 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.56-MariaDB' socket: '/var/lib/mysqld/mysqld.sock' port: 3306 MariaDB Server
170525 17:56:43 [Note] /usr/sbin/mysqld: Normal shutdown
170525 17:56:43 [Note] Event Scheduler: Purging the queue. 0 events
170525 17:56:43 InnoDB: Starting shutdown...
170525 17:56:45 InnoDB: Shutdown completed; log sequence number 1597945
170525 17:56:45 [Note] /usr/sbin/mysqld: Shutdown complete
170525 17:56:45 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170525 17:56:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170525 17:56:46 [Note] /usr/sbin/mysqld (mysqld 5.5.56-MariaDB) starting as process 5135 ...
170525 17:56:46 InnoDB: The InnoDB memory heap is disabled
170525 17:56:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170525 17:56:46 InnoDB: Compressed tables use zlib 1.2.7
170525 17:56:46 InnoDB: Using Linux native AIO
170525 17:56:46 InnoDB: Initializing buffer pool, size = 32.0M
170525 17:56:46 InnoDB: Completed initialization of buffer pool
170525 17:56:46 InnoDB: highest supported file format is Barracuda.
170525 17:56:46 InnoDB: Waiting for the background threads to start
170525 17:56:47 Percona XtraDB (http://www.percona.com) 5.5.52-MariaDB-38.3 started; log sequence number 1597945
170525 17:56:47 [Note] Plugin 'FEEDBACK' is disabled.
170525 17:56:47 [Note] Server socket created on IP: '0.0.0.0'.
170525 17:56:47 [Warning] 'user' entry 'root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:47 [Warning] 'user' entry '@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:47 [Warning] 'proxies_priv' entry '@ root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:56:47 [Note] Event Scheduler: Loaded 0 events
170525 17:56:47 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.56-MariaDB' socket: '/var/lib/mysqld/mysqld.sock' port: 3306 MariaDB Server
170525 17:57:27 [Warning] 'user' entry 'root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:57:27 [Warning] 'user' entry '@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:57:27 [Warning] 'proxies_priv' entry '@ root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 17:57:27 [Warning] 'proxies_priv' entry '@ root@skdylan31.fvds.ru' ignored in --skip-name-resolve mode.
170525 18:56:16 [Note] /usr/sbin/mysqld: Normal shutdown
170525 18:56:16 [Note] Event Scheduler: Purging the queue. 0 events
170525 18:56:16 InnoDB: Starting shutdown...
170525 18:56:17 InnoDB: Shutdown completed; log sequence number 14009533
170525 18:56:17 [Note] /usr/sbin/mysqld: Shutdown complete
170525 18:56:17 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
<?php
/**
* @link
*/
declare(ticks = 1);
$stop = FALSE;
/**
* Функция перехватывающая сигналы
*/
function sig_handler($signo)
{
global $stop;
switch ($signo)
{
case SIGTERM:
$stop = TRUE;
break;
case SIGUSR1:
break;
default:
// Ловим все остальные сигналы
}
}
// Регистрируем сигналы
pcntl_signal(SIGTERM, "sig_handler");
pcntl_signal(SIGUSR1, "sig_handler");
// Форкаем процесс
$pid = pcntl_fork();
echo $pid.PHP_EOL;
if ($pid == -1)
{
// Ошибка
//die('could not fork'.PHP_EOL);
}
else if ($pid)
{
// Родительский процесс, убиваем
die('die parent process'.PHP_EOL);
}
else
{
$fp = fopen('/home/bitrix/www/bitrix/modules/test.testmodule/counter.txt', 'w');
// Новый процесс, запускаем главный цикл
while( ! $stop )
{
sleep(1);
// полезная работа
}
}
// Отцепляемся от терминала
?>