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
RFE: implement wrapper for posix.fork()+posix.exec() #389
Comments
It might also be nice to use |
ignatenkobrain
added a commit
to ignatenkobrain/rpm
that referenced
this issue
Feb 6, 2018
As Florian Weimer says, posix_spawn() can be implemented more efficiently than usual fork() / execve() sequence. Fixes: rpm-software-management#389 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
@n3npq except that RPM doesn't use lua posix module... It implements its own. |
ignatenkobrain
added a commit
to ignatenkobrain/rpm
that referenced
this issue
Feb 6, 2018
At this point, if you want to avoid using shell you have only option which is to use posix.fork() and posix.exec() which is too verbose and not optional (as Florian Weimer says, posix_spawn() can be implemented more efficiently than usual fork() / execve() sequence). Typical use-case is shown below. -- Before pid = posix.fork() if pid == 0 then assert(posix.exec("/foo/bar")) elseif pid > 0 then posix.wait(pid) end -- After assert(posix.spawn("/foo/bar")) Fixes: rpm-software-management#389 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Closed
Submitted #390 for this. |
ignatenkobrain
added a commit
to ignatenkobrain/rpm
that referenced
this issue
Feb 6, 2018
At this point, if you want to avoid using shell you have only option which is to use posix.fork() and posix.exec() which is too verbose and not optimal (as Florian Weimer says, posix_spawn() can be implemented more efficiently than usual fork() / execve() sequence). Typical use-case is shown below. -- Before pid = posix.fork() if pid == 0 then assert(posix.exec("/foo/bar")) elseif pid > 0 then posix.wait(pid) end -- After assert(posix.spawn("/foo/bar")) Fixes: rpm-software-management#389 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
rpm.execute() added in commit 18e7923 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many of packages which use filetriggers (e.g glibc and systemd) use following construction:
this is just not user friendly and we could implement something like
rpm.execute([args])
which would do all this boring things. Another option is definitely to create macro for this (like%rpm_lua_execute
), but it's probably not user-friendly.The text was updated successfully, but these errors were encountered: