diff --git a/debian/build_deb.sh b/debian/build_deb.sh index d073e50..152dc90 100755 --- a/debian/build_deb.sh +++ b/debian/build_deb.sh @@ -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 diff --git a/debian/nflux.service b/debian/nflux.service index ae20105..33af3c8 100644 --- a/debian/nflux.service +++ b/debian/nflux.service @@ -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 diff --git a/debian/postinst b/debian/postinst index 2266e4e..aaaeaa1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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 diff --git a/debian/postrm b/debian/postrm index 74c0f2a..7b700fd 100755 --- a/debian/postrm +++ b/debian/postrm @@ -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