Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a UID is not working #268

Open
jxns opened this issue May 27, 2022 · 3 comments
Open

Passing a UID is not working #268

jxns opened this issue May 27, 2022 · 3 comments
Labels

Comments

@jxns
Copy link

jxns commented May 27, 2022

The Question:
I am trying to pass UID: 0 to the Python Shell in order to execute my script as root as recommended in #41 . But this only results in the following error:

Uncaught Exception:
Error: spawn EPERM
at ChildProcess.spawn (node:internal/child_process:412:11)
at spawn (node:child_process:707:9)
at new PythonShell (/home/pi/Desktop/app/node_modules/python-shell/index.js:127:55)
at Function.run (/home/pi/Desktop/app/node_modules/python-shell/index.js:249:23)
at IpcMainImpl. (/home/pi/Desktop/app/main.js:100:17)
at IpcMainImpl.emit (node:events:390:28)
at EventEmitter. (node:electron/js2c/browser_init:161:10780)
at EventEmitter.emit (node:events:390:28)

I am using the following code:

PythonShell.run(arg, {uid: 2}, function(err, results){
});

Is there any way to run the child process with sudo privileges?

@jxns jxns added the question label May 27, 2022
@Almenon
Copy link
Collaborator

Almenon commented Sep 30, 2022

Are you running your node script as root (sudo)?

@jxns
Copy link
Author

jxns commented Sep 30, 2022

No. I am using Electron. Running Electron as root is not supported.

@Almenon
Copy link
Collaborator

Almenon commented Dec 17, 2022

electron/packager#647 might be helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants