postinst: start nasctl service after install so it's immediately running

This commit is contained in:
2026-07-05 21:21:33 -04:00
parent 4f0754ecc5
commit d6b184d19b
+1 -1
View File
@@ -32,7 +32,7 @@ package: build-all
cp bin/$(BINARY)-linux-amd64 dist/deb/usr/local/bin/$(BINARY) cp bin/$(BINARY)-linux-amd64 dist/deb/usr/local/bin/$(BINARY)
cp systemd/nasctl.service dist/deb/etc/systemd/system/$(BINARY).service cp systemd/nasctl.service dist/deb/etc/systemd/system/$(BINARY).service
printf 'Package: nasctl\nVersion: $(VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: nasctl\nDescription: Monolithic NAS control plane\n' > dist/deb/DEBIAN/control printf 'Package: nasctl\nVersion: $(VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: nasctl\nDescription: Monolithic NAS control plane\n' > dist/deb/DEBIAN/control
printf '#!/bin/sh\nset -e\ninstall -d /var/lib/nasctl\nsystemctl daemon-reload\nsystemctl enable nasctl.service || true\n' > dist/deb/DEBIAN/postinst printf '#!/bin/sh\nset -e\ninstall -d /var/lib/nasctl\nsystemctl daemon-reload\nsystemctl enable nasctl.service || true\nsystemctl start nasctl.service\n' > dist/deb/DEBIAN/postinst
chmod 0755 dist/deb/DEBIAN/postinst chmod 0755 dist/deb/DEBIAN/postinst
dpkg-deb --build dist/deb dist/nasctl_$(VERSION)_amd64.deb dpkg-deb --build dist/deb dist/nasctl_$(VERSION)_amd64.deb