Skip to content

Commit

Permalink
Improve debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
containerscrew committed Jan 23, 2025
1 parent 3cee980 commit fa93f55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion debian/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp debian/postrm deb-build/nflux/DEBIAN/
cp nflux.toml deb-build/nflux/etc/nflux/nflux.toml

# Build the Rust binary and place it in the package structure
cargo xtask build --release
cargo build --release
cp target/release/nflux deb-build/nflux/usr/local/bin/

# Set permissions for package files
Expand Down
13 changes: 7 additions & 6 deletions debian/nflux.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Restart=on-failure
PIDFile=/run/nflux.pid
User=root
Group=root
StandardOutput=journal
StandardError=journal
# Alternatively, if you want to log to a file, uncomment these:
# StandardOutput=file:/tmp/nflux.log
# StandardError=file:/tmp/nflux.log
# EnvironmentFile=/etc/nflux/nflux.env
# StandardOutput=journal
# StandardError=journal
StandardOutput=file:/var/log/nflux/nflux.log
StandardError=file:/var/log/nflux/nflux.log

# Other
#EnvironmentFile=/etc/nflux/nflux.env

[Install]
WantedBy=multi-user.target
4 changes: 3 additions & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -e

# Enable and start the service after installation
systemctl enable nflux --now
# systemctl enable nflux --now
sudo mkdir /var/log/nflux
systemctl enable nflux

exit 0
5 changes: 3 additions & 2 deletions debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ case "$1" in
;;
purge)
# Remove config and service files during a full purge
rm -f /etc/systemd/system/nflux.service
rm -rf /etc/nflux
rm -rf /etc/systemd/system/nflux.service
rm -rf /etc/nflux/nflux.toml
rm -rf /var/log/nflux
systemctl daemon-reload
;;
esac
Expand Down

0 comments on commit fa93f55

Please sign in to comment.