I have a piece of software that is able to read commands from stdin for debug purposes in a separate thread. When my software runs as foreground process read behaves as expected, its blocking and waits for input by the user, i.e the thread sleeps. When the software is run as a background process, read constantly returns 0 (possible EOF
Tag: background-process
PHP kill exec() background process after php-fpm restarted
I use nginx and php7.1-fpm. I want to run a background process using PHP and exec(). My short code: Unfortunately after the systemd restart php7.1-fpm the program is killed. I have tried to run with a different user than the one running the pool: However, this does not solve the problem – still kills. I can not use ssh2_connect(). How
bash loop with GNU less that refreshes every 2 minutes
I have a linux machine with a data folder and a script that produces a report xlsx spreadsheet file on the ever changing content of the folder where it is being run. I use a xlsx2tsv script to convert it to tsv text which takes less than one second. The script takes about 1 minute to produce the spreadsheet file
Start background processes from a background process
I have a PHP script say test.php in linux Ubuntu, in this PHP script I use shell_exec() to start several background processes. When I execute php test.php, the background processes are started as expected, but when I run php test.php &, those several background processes are not started. Is it not a supported way to start background processes from a
how to find whether a script run as a nohup finished or not?
I tried running a script using nohup like, When I tried I couldn’t find it there except for the grep which is being run with that string as a parameter. Am I doing it right?. Does this mean that the process has indeed finished execution? Thanks. Answer At the beginning of your shell script, write the PID to a file