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

Is there a way to make a count from the child process available to parent process so that the parent process can print it?

I am trying to use the child process to count characters in a string and then make that count available to the parent process so that the parent process can print it out. After hours of videos and reading I still cant find a way to make something…
m123332
  • 21
  • 3
0
votes
0 answers

spawn ENOENT error in windows while running execFile (node js)

Im trying to run a C file using child process in node.js. Im using execFile to do this, the 'test' file is in the same folder. The same program runs on linux and gives the output but doesn't run on windows. It shows error: spawn ./test ENONET on…
Nvv
  • 79
  • 10
0
votes
1 answer

Child processes are sharing the same variable in memory which is created after fork() is called (C)

I am working on a script where fork() is called in a for loop to create many children, these children do a random number of loops and then print the name of the child I'm having some odd behavior where the memory address that i is at is shared for…
Coolroo
  • 57
  • 6
0
votes
1 answer

npm install only fails when used with child_process.exec

Running this in my terminal: npm i --save-dev typescript 'https://gitpkg.now.sh/pylonbot/pylon-sdk-types/runtime' 'https://gitpkg.now.sh/pylonbot/pylon-sdk-types/runtime-discord' Installs the packages as would be expected. But, when I try to use…
liamhtml
  • 21
  • 1
  • 4
0
votes
0 answers

NodeJS child_process and express: terminate previous process and run a new one when a new POST request is made

I have this code that calls the nfc-forum-emulate-tag4 command on a file that the code also creates, containing a NDEF text record of the data received in the POST request. However, nfc-forum-emulate-tag4 runs indefinitely until the tag is scanned…
0
votes
1 answer

Node.js send input text to python script for processing and writing the output on a div on the same page

I am trying to take text from an HTML input field and send it via POST-request to a python script for processing (I am using child process). Right now, I am just sending the processed data to the response and overwriting the index.html, but I would…
Python Dong
  • 85
  • 1
  • 5
0
votes
0 answers

memory not free properly when fork

I can't see what i'm doing wrong, this output from valgrind say that i did not free properly the variable, but when i remove the fork from code i can see that this is free properly, so what is wrong is the fork and i dont know how to fix it. Resume…
0
votes
1 answer

Node.js child_process module with git command

First, Please understand that it's not smooth because I use a translator. I want to create an API server using the child_process module in node.js to send git command. ex) git clone ..., git pull, git push , ... And i succeeded! But there's a big…
2nan
  • 11
  • 5
0
votes
1 answer

Executing shell command using child process

I am trying to execute a command to fork a chain using ganache. I have struggled to find a way to do the fork programmatically so I want to try execute it through a child process. The code I am using is: const { exec } =…
Notmyname
  • 65
  • 1
  • 1
  • 5
0
votes
0 answers

Never ending shell command with execSync()

I build VS Code extension I have wrapper in a class like this public exec(cmd: string): string { try { return execSync(cmd, { cwd: this.workspaceRoot }).toString(); } catch (e) { return '' + e; } } If in the code I…
0
votes
1 answer

How can I pass stdout from one child process to another child process in nodejs?

I'm getting a cryptic error when I try to pass the stdout from on process to the stdin of another process. // test.js const child_process = require("child_process"); const proc = child_process.spawn("ls", ["-a"]); const res =…
island
  • 43
  • 5
0
votes
1 answer

How to kill a NodeJS child exec process?

I'm executing a Python program from NodeJS using exec function of child_process and I wish to kill the process on a button click. Am using Windows11. Here is my code : var process__ = undefined; // this is a global variable function…
Pervez
  • 391
  • 1
  • 10
0
votes
1 answer

Capturing the *complete* output stream of a child_process in NodeJS

I've been trying to capture the output of a child_process for a while now. The following code example is my current attempt. Code: // Spawning a shell var terminal = require('child_process').spawn(`sh`, [], { stdio: [ 'inherit', 'pipe', 'inherit']…
santcleep
  • 3
  • 3
0
votes
1 answer

How to process a large file on a SpringBoot on a Child thread?

The requirement is accept a large file <1GB, save it to the DB, return the newly generated ID to be displayed in GUI & kick off the file processing as a child process / async process. This question partially answers my query best way of reading…
Arijit Datta
  • 101
  • 1
  • 2
  • 10
0
votes
1 answer

Serverless offline child process - spawn serverless ENOENT

I am using GitLab's serverless framework template and trying to run tests locally first, by creating a child serverless offline process. I am getting the error 'spawn serverless ENOENT' when executing the jest tests. Any idea why? let…
jk_77
  • 1
  • 1