aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/peertube-runner
diff options
context:
space:
mode:
Diffstat (limited to 'packages/peertube-runner')
-rw-r--r--packages/peertube-runner/peertube-runner.ts11
-rw-r--r--packages/peertube-runner/shared/ipc/ipc-client.ts15
2 files changed, 21 insertions, 5 deletions
diff --git a/packages/peertube-runner/peertube-runner.ts b/packages/peertube-runner/peertube-runner.ts
index 9c3e498d6..858d85e6a 100644
--- a/packages/peertube-runner/peertube-runner.ts
+++ b/packages/peertube-runner/peertube-runner.ts
@@ -31,7 +31,7 @@ program.command('server')
31 try { 31 try {
32 await RunnerServer.Instance.run() 32 await RunnerServer.Instance.run()
33 } catch (err) { 33 } catch (err) {
34 logger.error('Cannot run PeerTube runner as server mode', err) 34 logger.error(err, 'Cannot run PeerTube runner as server mode')
35 process.exit(-1) 35 process.exit(-1)
36 } 36 }
37 }) 37 })
@@ -46,7 +46,8 @@ program.command('register')
46 try { 46 try {
47 await registerRunner(options) 47 await registerRunner(options)
48 } catch (err) { 48 } catch (err) {
49 logger.error('Cannot register this PeerTube runner.', err) 49 console.error('Cannot register this PeerTube runner.')
50 console.error(err)
50 process.exit(-1) 51 process.exit(-1)
51 } 52 }
52 }) 53 })
@@ -58,7 +59,8 @@ program.command('unregister')
58 try { 59 try {
59 await unregisterRunner(options) 60 await unregisterRunner(options)
60 } catch (err) { 61 } catch (err) {
61 logger.error('Cannot unregister this PeerTube runner.', err) 62 console.error('Cannot unregister this PeerTube runner.')
63 console.error(err)
62 process.exit(-1) 64 process.exit(-1)
63 } 65 }
64 }) 66 })
@@ -69,7 +71,8 @@ program.command('list-registered')
69 try { 71 try {
70 await listRegistered() 72 await listRegistered()
71 } catch (err) { 73 } catch (err) {
72 logger.error('Cannot list registered PeerTube instances.', err) 74 console.error('Cannot list registered PeerTube instances.')
75 console.error(err)
73 process.exit(-1) 76 process.exit(-1)
74 } 77 }
75 }) 78 })
diff --git a/packages/peertube-runner/shared/ipc/ipc-client.ts b/packages/peertube-runner/shared/ipc/ipc-client.ts
index 7f5951157..db8d7f1bf 100644
--- a/packages/peertube-runner/shared/ipc/ipc-client.ts
+++ b/packages/peertube-runner/shared/ipc/ipc-client.ts
@@ -11,8 +11,21 @@ export class IPCClient {
11 await ensureDir(ConfigManager.Instance.getSocketDirectory()) 11 await ensureDir(ConfigManager.Instance.getSocketDirectory())
12 12
13 const socketPath = ConfigManager.Instance.getSocketPath() 13 const socketPath = ConfigManager.Instance.getSocketPath()
14
14 this.netIPC = new NetIPC({ path: socketPath }) 15 this.netIPC = new NetIPC({ path: socketPath })
15 await this.netIPC.connect() 16
17 try {
18 await this.netIPC.connect()
19 } catch (err) {
20 if (err.code === 'ECONNREFUSED') {
21 throw new Error(
22 'This runner is not currently running in server mode on this system. ' +
23 'Please run it using the `server` command first (in another terminal for example) and then retry your command.'
24 )
25 }
26
27 throw err
28 }
16 } 29 }
17 30
18 async askRegister (options: { 31 async askRegister (options: {