From 0350d87ee44be7eebdfc3a8f135a28a2eb65a209 Mon Sep 17 00:00:00 2001 From: Matthew Kienow Date: Wed, 9 Jan 2019 17:42:57 -0500 Subject: [PATCH] Add background process ID output --- msfrpcd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/msfrpcd b/msfrpcd index 91ec1ad328..9cce6339e9 100755 --- a/msfrpcd +++ b/msfrpcd @@ -87,7 +87,11 @@ def start_rpc_service(opts, frameworkOpts, foreground) $stdout.puts "[*] #{RPC_TYPE.upcase}RPC ready at #{Time.now}." else $stderr.puts "[*] #{RPC_TYPE.upcase}RPC backgrounding at #{Time.now}..." - exit(0) if Process.fork() + child_pid = Process.fork() + if child_pid + $stderr.puts "[*] #{RPC_TYPE.upcase}RPC background PID #{child_pid}" + exit(0) + end end rescue ::NotImplementedError $stderr.puts "[-] Background mode is not available on this platform" @@ -207,6 +211,7 @@ if $PROGRAM_NAME == __FILE__ $stderr.puts "[*] JSON-RPC starting on #{opts['ServerHost']}:#{opts['ServerPort']} (#{opts['SSL'] ? "SSL" : "NO SSL"})..." $stderr.puts "[*] URI: /api/v1/json-rpc" $stderr.puts "[*] JSON-RPC server log: #{ws_log}" unless foreground + $stderr.puts "[*] JSON-RPC server PID file: #{ws_rpc_pid}" unless foreground ws_conf_full_path = File.expand_path(File.join(File.dirname(msfbase), WS_CONF))