Skip to content

Commit 29ca2cb

Browse files
committed
fix: unify upgrade flow to stop/download/start for all platforms
Linux binary previously used download + systemctl restart, which assumed a default service name and didn't handle custom daemon names. Now all platforms (Linux, macOS, Windows) use the same 3-step flow: stop daemon, download update, start daemon — with --name flag included when the daemon has a custom name.
1 parent 077800d commit 29ca2cb

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

messages/de.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@
371371
"daemons_upgradeDaemon": "",
372372
"daemons_upgradeConfigPreserved": "",
373373
"daemons_upgradeDownload": "",
374-
"daemons_upgradeRestartSystemd": "",
375374
"daemons_upgradeStartProcess": "",
376375
"daemons_upgradeStopProcess": "",
377376
"daemons_useExistingKey": "",

messages/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@
407407
"daemons_upgradeDaemon": "Upgrade Daemon",
408408
"daemons_upgradeConfigPreserved": "Your daemon configuration is preserved automatically — no need to re-enter server URL, API key, or other settings.",
409409
"daemons_upgradeDownload": "Download the latest version:",
410-
"daemons_upgradeRestartSystemd": "Restart the daemon service:",
411410
"daemons_upgradeStartProcess": "Start the daemon:",
412411
"daemons_upgradeStopProcess": "Stop the running daemon:",
413412
"daemons_useExistingKey": "Use existing API key",

messages/fr.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@
379379
"daemons_upgradeDaemon": "",
380380
"daemons_upgradeConfigPreserved": "",
381381
"daemons_upgradeDownload": "",
382-
"daemons_upgradeRestartSystemd": "",
383382
"daemons_upgradeStartProcess": "",
384383
"daemons_upgradeStopProcess": "",
385384
"daemons_useExistingKey": "",

messages/pt.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@
371371
"daemons_upgradeDaemon": "",
372372
"daemons_upgradeConfigPreserved": "",
373373
"daemons_upgradeDownload": "",
374-
"daemons_upgradeRestartSystemd": "",
375374
"daemons_upgradeStartProcess": "",
376375
"daemons_upgradeStopProcess": "",
377376
"daemons_useExistingKey": "",

ui/src/lib/features/daemons/components/DaemonUpgradeModal.svelte

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
daemons_upgradeConfigPreserved,
2525
daemons_upgradeDownload,
2626
daemons_upgradeDaemon,
27-
daemons_upgradeRestartSystemd,
2827
daemons_upgradeStartProcess,
2928
daemons_upgradeStopProcess
3029
} from '$lib/paraglide/messages';
@@ -46,12 +45,11 @@
4645
// Whether daemon has a custom name (non-default needs --name flag on restart)
4746
let hasCustomName = $derived(daemon.name !== 'scanopy-daemon');
4847
49-
// Commands for upgrading
48+
// Commands for upgrading — all platforms use stop/download/start flow
5049
const binaryUpgradeCommand = `bash -c "$(curl -fsSL https://raw.githubusercontent.com/scanopy/scanopy/refs/heads/main/install.sh)"`;
51-
const systemdRestart = 'sudo systemctl restart scanopy-daemon';
5250
53-
const macosStopCommand = 'sudo pkill scanopy-daemon';
54-
let macosStartCommand = $derived(
51+
const stopCommand = 'sudo pkill scanopy-daemon';
52+
let startCommand = $derived(
5553
hasCustomName ? `sudo scanopy-daemon --name ${daemon.name}` : 'sudo scanopy-daemon'
5654
);
5755
@@ -102,18 +100,25 @@ docker compose up -d`;
102100
>
103101
{#if selectedOS === 'linux'}
104102
{#if linuxMethod === 'binary'}
105-
<!-- Linux Binary: download + systemd restart -->
103+
<!-- Linux Binary: stop, download, start -->
106104
<div class="space-y-3">
107105
<div class="text-secondary">
108106
<b>{common_stepNumber({ number: '1' })}</b>
107+
{daemons_upgradeStopProcess()}
108+
</div>
109+
<CodeContainer language="bash" expandable={false} code={stopCommand} />
110+
<div class="text-secondary">
111+
<b>{common_stepNumber({ number: '2' })}</b>
109112
{daemons_upgradeDownload()}
110113
</div>
111114
<CodeContainer language="bash" expandable={false} code={binaryUpgradeCommand} />
112115
<div class="text-secondary">
113-
<b>{common_stepNumber({ number: '2' })}</b>
114-
{daemons_upgradeRestartSystemd()}
116+
<b>{common_stepNumber({ number: '3' })}</b>
117+
{daemons_upgradeStartProcess()}
115118
</div>
116-
<CodeContainer language="bash" expandable={false} code={systemdRestart} />
119+
<CodeContainer language="bash" expandable={false} code={startCommand} />
120+
121+
<InlineInfo title="" body={daemons_upgradeConfigPreserved()} />
117122
</div>
118123
{:else if linuxMethod === 'docker'}
119124
<!-- Linux Docker Compose -->
@@ -148,7 +153,7 @@ docker compose up -d`;
148153
<b>{common_stepNumber({ number: '1' })}</b>
149154
{daemons_upgradeStopProcess()}
150155
</div>
151-
<CodeContainer language="bash" expandable={false} code={macosStopCommand} />
156+
<CodeContainer language="bash" expandable={false} code={stopCommand} />
152157
<div class="text-secondary">
153158
<b>{common_stepNumber({ number: '2' })}</b>
154159
{daemons_upgradeDownload()}
@@ -158,7 +163,7 @@ docker compose up -d`;
158163
<b>{common_stepNumber({ number: '3' })}</b>
159164
{daemons_upgradeStartProcess()}
160165
</div>
161-
<CodeContainer language="bash" expandable={false} code={macosStartCommand} />
166+
<CodeContainer language="bash" expandable={false} code={startCommand} />
162167

163168
<InlineInfo title="" body={daemons_upgradeConfigPreserved()} />
164169
<InlineInfo title={daemons_dockerLinuxOnly()} body={daemons_dockerLinuxOnlyBody()} />

0 commit comments

Comments
 (0)