@plosson/agentio 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/gateway.ts +7 -3
package/package.json
CHANGED
package/src/commands/gateway.ts
CHANGED
|
@@ -80,7 +80,7 @@ After=network.target
|
|
|
80
80
|
|
|
81
81
|
[Service]
|
|
82
82
|
Type=simple
|
|
83
|
-
ExecStart=${binaryPath} gateway start
|
|
83
|
+
ExecStart=${binaryPath} gateway start --foreground
|
|
84
84
|
Restart=always
|
|
85
85
|
RestartSec=5
|
|
86
86
|
Environment=HOME=${process.env.HOME}
|
|
@@ -190,9 +190,13 @@ export function registerGatewayCommands(program: Command): void {
|
|
|
190
190
|
gateway
|
|
191
191
|
.command('start')
|
|
192
192
|
.description('Start the gateway')
|
|
193
|
-
.
|
|
193
|
+
.option('--foreground', 'Run in foreground (used by systemd)')
|
|
194
|
+
.action(async (options) => {
|
|
194
195
|
try {
|
|
195
|
-
if (
|
|
196
|
+
if (options.foreground) {
|
|
197
|
+
// Run directly in foreground (called by systemd or for dev)
|
|
198
|
+
await startGateway();
|
|
199
|
+
} else if (isServiceInstalled()) {
|
|
196
200
|
// Use systemctl
|
|
197
201
|
const { isRoot } = checkRoot();
|
|
198
202
|
const result = runCommand(['systemctl', 'start', SERVICE_NAME], !isRoot);
|