Skip to content

Commit 607c9a1

Browse files
committed
pkg/fms/system: Install gizmo-fms as system service
1 parent f17e8b2 commit 607c9a1

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

internal/cmdlets/fms_system_install.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ func fmsSystemInstallCmdRun(c *cobra.Command, args []string) {
2929
appLogger.Error("Fatal Error during install", "error", err)
3030
}
3131

32+
if err := setuptool.SetupGizmoFMSSvc(); err != nil {
33+
appLogger.Error("Fatal Error during system service setup", "error", err)
34+
}
35+
3236
if err := setuptool.SetupBoot(); err != nil {
3337
appLogger.Error("Fatal Error during boot setup", "error", err)
3438
}

pkg/fms/system/system_setup.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const (
1919
// We need to be before sysctls, which fire at 08.
2020
coresvc = "/etc/runit/core-services/06-gizmo.sh"
2121

22+
gizmoFMSSvc = "/etc/sv/gizmo-fms/run"
23+
2224
promConf = "/etc/prometheus/prometheus.yml"
2325
sysctlConf = "/etc/sysctl.conf"
2426
dhcpcdConf = "/etc/dhcpcd.conf"
@@ -136,6 +138,13 @@ func (st *SetupTool) SetupBoot() error {
136138
return st.sc.Template(coresvc, "tpl/coresvc.sh.tpl", 0644, nil)
137139
}
138140

141+
// SetupGizmoFMSSvc installs the Gizmo FMS service. This has to happen
142+
// at early install time as the core-service will try to enable it,
143+
// which can only happen if the service already exists in the image.
144+
func (st *SetupTool) SetupGizmoFMSSvc() error {
145+
return st.sc.Template(gizmoFMSSvc, "tpl/gizmo-fms.run.tpl", 0755, nil)
146+
}
147+
139148
// Configure calls all the configure steps to configure the FMS workstation.
140149
func (st *SetupTool) Configure() error {
141150
st.detectPlatform()
@@ -325,6 +334,7 @@ func (st *SetupTool) enableServices() error {
325334
"prometheus",
326335
"sddm",
327336
"seatd",
337+
"gizmo-fms",
328338
}
329339
for _, s := range svcs {
330340
st.l.Info("Enabling Service", "service", s)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
[ -r ./conf ] && . ./conf
4+
cd /var/lib/gizmo || exit 1
5+
[ -r fms.json ] || echo '{}' | chpst -u _gizmo tee fms.json > /dev/null
6+
exec chpst -u _gizmo /usr/local/bin/gizmo fms run

0 commit comments

Comments
 (0)