Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model/sys-desc/shelltime.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target

[Service]
Type=simple
ExecStart=/bin/sh -c 'exec $(getent passwd $USER | cut -d: -f7) -l -c "/usr/local/bin/shelltime-daemon"'
ExecStart=/bin/sh -c 'exec $(getent passwd $USER | cut -d: -f7) -l -c "{{.BaseFolder}}/bin/shelltime-daemon"'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces the {{.BaseFolder}} template variable, which is a good step towards removing hardcoded paths. However, the Go code that processes this template has not been updated to supply this new variable. This will cause the service file to be generated with an incorrect path for ExecStart, breaking the daemon installation on Linux.

To fix this, you need to update the GetDaemonServiceFile function in model/daemon-installer.linux.go to pass BaseFolder to the template execution context. The baseFolder is available on the LinuxDaemonInstaller struct.

Here's the required change in model/daemon-installer.linux.go (around line 168):

	err = tmpl.Execute(&buf, map[string]string{
		"UserName":   username,
		"BaseFolder": l.baseFolder,
	})

Without this change, the daemon installation will fail.

Restart=always

# Resource limits
Expand Down