Questions tagged [child-process]

For questions regarding child-process

In Unix, a child process is typically created as a copy of the parent, using the fork system call. The child process can then overlay itself with a different program (using exec) as required.

Each process may create many child processes but will have at most one parent process; if a process does not have a parent this usually indicates that it was created directly by the kernel.

The inter communication between a child process and a parent process can be done through normal communication schemes such as pipes, sockets, message queues, shared memories.

When a child process terminates, some information is returned to the parent process. When a child process terminates before the parent has called wait, the kernel retains some information about the process, such as its exit status, to enable its parent to call wait later

2233 questions
0
votes
1 answer

Problems with exiting from CLI

I've created simple CLI using inquirer and child_process. And i have problem, when i'am closing process with CTLR+C, it seems like its still running process, because terminal not responding anything. And i have to close terminal every time and open…
0
votes
1 answer

Child Process prints normal outputs from stderror while using Pacman -U

The problem is basically, child process prints normal outputs as errors and I think that causes to something being stopped. ERROR 1 ==> WARNING: A package has already been built, installing existing package... [sudo] password for user: // That…
rch
  • 127
  • 1
  • 7
0
votes
0 answers

Not able to run child process in node kafka consumer

const { spawn } = require('child_process'); const child = spawn('dir', ['./kafka'], { shell: true }); child.stdout.on('data', (data) => { console.log("child process started"); }); child.stderr.on('data', (data) => { console.error("failed to…
0
votes
0 answers

How to prevent a infinite loop in nodejs child process spwan

I'm building an online ide by running the command to execute the code by spawn... but what should I do if there is an infinite loop in the code...The process is not being stopped const { childElements } = require("dom-helpers"); const path =…
Aditya Harsh
  • 21
  • 1
  • 4
0
votes
0 answers

Python-shell problem after packaging my app with electron builder (Node Js)

I finished my electron/node js & Python app (a steganography tool). So I'd like to package it to distribute it on github with a dmg, exe... So I installed electron-builder as my packager but when i package my app by taping: npm run dist or yarn run…
0
votes
0 answers

ExpressJs spawn new CPU intensive task on request

This is a system architecture design question, so I'm not sure if it fits here. Excuse me if it doesn't and feel free to suggest the appropriate community. I have an ExpressJs server and a Python script that runs a CPU intensive task, typically it…
Mike Pham
  • 437
  • 6
  • 17
0
votes
1 answer

node.js second spawned child process doesn't receive stdin messages

I have an event in my node.js script which need to be called multiple times that spawns a child process. Not parallel just one child process at the time. var child = spawn('node', [script, arg1],{cwd: "./", stdio: …
0
votes
1 answer

Spawning top with arguments and parsing with grep

I want to spawn top with a few arguments to get the current cpu load & usage. If I type the full command on my ssh session top -bn1 | grep "Cpu(s)\|top -", I get the complete and working response. But how is the correct way to spawn this command…
borsTiHD
  • 253
  • 3
  • 17
0
votes
0 answers

C/bash: signal one process on the death of another

Think of this as a continuation of the good advice here: https://stackoverflow.com/a/56780616/16739703 except that I am hoping not to modify the child process. Edit: I have written code which minimises to: #include #include…
JamesC1
  • 1
  • 1
0
votes
0 answers

Node child process spawn not executing command

I am trying to execute a child process command to convert a file from a format to another using FFmpeg. I have FFmpeg installed in my system and in the same code I am able to successfully merge a video and a file using cp.spawn. The next step would…
Daniel
  • 487
  • 4
  • 11
0
votes
1 answer

Can I run nodejs child-process (command line) in heroku?

I have created an app.js file that tries to run node span child-process. With that child process I tried to run mongodump (mongodb utility to create backups). In my local computer that codes works but in my node server in heroku the code fails and…
Rupak
  • 529
  • 6
  • 16
0
votes
0 answers

NodeJs synchronous child process

I'm trying to build a certificate generation module using nodeJS. The api to create certificate is as follows // Create certificate const express = require('express'); const router = express.Router(); const { createCanvas } =…
sheetaldharerao
  • 482
  • 3
  • 11
0
votes
1 answer

not able to kill process in node.js

I am working on a node script where I will be opening and closing the browser using child process but its opening the browser but not able to close it on pressing Ctrl + C. Here's my code: const { kill } = require('process'); var start =…
rudeTool
  • 526
  • 1
  • 11
  • 25
0
votes
0 answers

How to exit the child process in javascript?

I am working on a node.js project where I have to define different endpoints to open and close browsers on specific endpoints. Like on: localhost:3000/open---> opens the browser localhost:3000/close---> closes the browser I have made child process…
rudeTool
  • 526
  • 1
  • 11
  • 25
0
votes
0 answers

Why is Puppeteer not displayed as a child process on IIS?

I have a node.js server which runs a child process on the server when the user requests. This child process is managed by npm package 'child_process' and running a 'Puppeteer' script. The whole process works as expected on local. The problem is when…
daniron93
  • 1
  • 1