Created
April 18, 2016 18:51
-
-
Save rlipscombe/f1cb1d2fc6820b2fdc6e307e256cc0f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% erl -pa deps/exec/ebin -s exec | |
%% | |
%% c(exec_sup). | |
%% {ok, Pid} = exec_sup:start_link(). | |
%% | |
%% ps -ef | grep sleep | |
%% killall sleep | |
%% ps -ef | grep sleep | |
-module(exec_sup). | |
-export([start_link/0]). | |
-behaviour(supervisor). | |
-export([init/1]). | |
-export([exec_sleep/0]). | |
start_link() -> | |
supervisor:start_link(?MODULE, []). | |
init([]) -> | |
{ok, {{one_for_one, 10, 10}, | |
[ | |
{sleep, {?MODULE, exec_sleep, []}, permanent, 5000, worker, [?MODULE]} | |
]}}. | |
exec_sleep() -> | |
{ok, Pid, _} = exec:run_link("/bin/sleep 24h", []), | |
{ok, Pid}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment