git.iko.soy/distributed-process
on master help sign in
Figure out how to start background process
911bf29Edsko de Vries
distributed-process-azure/src/Control/Distributed/Process/Backend/Azure.hs+2−4
@@ -87,13 +87,11 @@ apiStartOnVM :: AzureParameters -> VirtualMachine -> IO ()
87apiStartOnVM params vm = do
87apiStartOnVM params vm = do
88 _ <- SSH.initialize True
88 _ <- SSH.initialize True
89 let ep = Azure.vmSshEndpoint vm
89 let ep = Azure.vmSshEndpoint vm
90− SSH.withSSH2 (azureSshKnownHosts params)
90+ _ <- SSH.withSSH2 (azureSshKnownHosts params)
91 (azureSshPublicKey params)
91 (azureSshPublicKey params)
92 (azureSshPrivateKey params)
92 (azureSshPrivateKey params)
93 (azureSshUserName params)
93 (azureSshUserName params)
94 (endpointVip ep)
94 (endpointVip ep)
95 (read $ endpointPort ep) $ \fd s ch -> do
95 (read $ endpointPort ep) $ \fd s ch -> do
96− _ <- SSH.retryIfNeeded fd s $ SSH.channelExecute ch "/home/edsko/testservice"
96+ SSH.retryIfNeeded fd s $ SSH.channelExecute ch "nohup /home/edsko/testservice >/dev/null 2>&1 &"
97− threadDelay $ 10 * 1000000 -- 10 seconds
98− return ()
99 SSH.exit
97 SSH.exit