try {
await RunnerServer.Instance.run()
} catch (err) {
- logger.error('Cannot run PeerTube runner as server mode', err)
+ logger.error(err, 'Cannot run PeerTube runner as server mode')
process.exit(-1)
}
})
try {
await registerRunner(options)
} catch (err) {
- logger.error('Cannot register this PeerTube runner.', err)
+ console.error('Cannot register this PeerTube runner.')
+ console.error(err)
process.exit(-1)
}
})
try {
await unregisterRunner(options)
} catch (err) {
- logger.error('Cannot unregister this PeerTube runner.', err)
+ console.error('Cannot unregister this PeerTube runner.')
+ console.error(err)
process.exit(-1)
}
})
try {
await listRegistered()
} catch (err) {
- logger.error('Cannot list registered PeerTube instances.', err)
+ console.error('Cannot list registered PeerTube instances.')
+ console.error(err)
process.exit(-1)
}
})
await ensureDir(ConfigManager.Instance.getSocketDirectory())
const socketPath = ConfigManager.Instance.getSocketPath()
+
this.netIPC = new NetIPC({ path: socketPath })
- await this.netIPC.connect()
+
+ try {
+ await this.netIPC.connect()
+ } catch (err) {
+ if (err.code === 'ECONNREFUSED') {
+ throw new Error(
+ 'This runner is not currently running in server mode on this system. ' +
+ 'Please run it using the `server` command first (in another terminal for example) and then retry your command.'
+ )
+ }
+
+ throw err
+ }
}
async askRegister (options: {
### Run the server
-Run the runner in server mode so it can run transcoding jobs of registered PeerTube instances:
+You need to run the runner in server mode first so it can run transcoding jobs of registered PeerTube instances:
```bash
peertube-runner server
### Register
-To register the runner on a new PeerTube instance so the runner can process its transcoding job:
+Then, you can register the runner on a new PeerTube instance so the runner can process its transcoding job:
```bash
peertube-runner register --url http://peertube.example.com --registration-token ptrrt-... --runner-name my-runner-name