msantos / alcove Goto Github PK
View Code? Open in Web Editor NEWControl plane for system processes
License: ISC License
Control plane for system processes
License: ISC License
There is a huge potential for using this library in beamparticle, but unfortunately, it does not support Mac OS X. This results in beamparticle/beamparticle#46
Summary: Is this library not meant to support Mac OS X?
It appears the stdout from a child process is not flushed entirely even when it exists.
RelativeFilePath = <<"somefile.erl.fun">>,
Path = <<"/opt/beamparticle-data/git-data/git-src">>,
CtrlDir = <<"/opt/beamparticle-data/git-data">>,
Drv = alcove_drv:start_link([{ctldir, CtlDir}]),
Command = <<"/usr/bin/git">>,
Args = [<<"log">>, <<"--follow">>, <<"--pretty=\"%h\"">>, <<"-z">>, RelativeFilePath],
TimeoutMsec = 5000,
The execute_command/5 is as follows:
execute_command(Drv, Path, Command, Args, TimeoutMsec) ->
{ok, ChildPID} = alcove:fork(Drv, []),
alcove:chdir(Drv, [ChildPID], Path),
EnvironmentVars = [],
ok = alcove:execve(Drv, [ChildPID], Command, [Command | Args],
EnvironmentVars),
lager:info("git-backend running command ~s ~s", [Command, Args]),
receive
{alcove_event, Drv, [ChildPID], {exit_status, ExitCode}} = Event ->
lager:info("git-backend received event ~p", [Event]),
Stdout = alcove:stdout(Drv, [ChildPID]),
Stderr = alcove:stderr(Drv, [ChildPID]),
{ExitCode, Stdout, Stderr}
after
TimeoutMsec ->
alcove:kill(Drv, [], ChildPID, 9),
{error, timeout}
end.
The output (stdout) gives a partial listing for SHA-1 hashes (see below). Additionally, notice that the first time it gave two hashes (which is also less) and the second time just one.
([email protected])8> beamparticle_gitbackend_server:git_log(<<"/opt/beamparticle-data/git-data/git-src">>, short, <<"weather_for_city.erl.fun">>, 5000).
07:31:22.299 [info] git-backend running command /usr/bin/git log--follow--pretty="%h"-zweather_for_city.erl.fun
07:31:22.369 [info] git-backend received event {alcove_event,<0.4500.0>,[12071],{exit_status,0}}
07:31:22.369 [info] Content = <<34,97,100,50,101,56,48,102,34,0,34,55,99,57,97,53,98,48,34,0>>
[<<"\"ad2e80f\"">>,<<"\"7c9a5b0\"">>,<<>>]
([email protected])9> beamparticle_gitbackend_server:git_log(<<"/opt/beamparticle-data/git-data/git-src">>, short, <<"weather_for_city.erl.fun">>, 5000).
07:31:23.568 [info] git-backend running command /usr/bin/git log--follow--pretty="%h"-zweather_for_city.erl.fun
07:31:23.644 [info] git-backend received event {alcove_event,<0.4500.0>,[12072],{exit_status,0}}
07:31:23.644 [info] Content = <<34,97,100,50,101,56,48,102,34,0>>
[<<"\"ad2e80f\"">>,<<>>]
Can alcove work with systemd which take the lead on the cgroup folder?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.