diff --git a/Cargo.toml b/Cargo.toml index 79a69fa7fb711f91a9bec668ccf96b461de3c5d0..b0adca524f51489ec07443d2e98a47dd9c22d740 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,18 @@ name = "balloon_tx_monolith" version = "0.1.0" edition = "2021" +license = "MIT" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.deb] +assets = [ + ["target/release/balloon_tx_monolith", "usr/bin/", "755"], + ["debian/balloon_monolith.service", "/lib/systemd/system/balloon_monolith.service", "644"], + ["config.toml.example", "/etc/balloon_tx/config.toml", "644"] +] +conf-files = ["/etc/balloon_tx/config.toml"] +maintainer-scripts = "debian/maintainer_scripts/" +copyright = "2023, Stephen D <@stephen:crabsin.space>" +maintainer = "Stephen D <@stephen:crabsin.space>" [dependencies] anyhow = "1.0.70" diff --git a/debian/balloon_monolith.service b/debian/balloon_monolith.service new file mode 100644 index 0000000000000000000000000000000000000000..bf423d78a7ef3a1c28b07ac59a1f8f7abcbea8c2 --- /dev/null +++ b/debian/balloon_monolith.service @@ -0,0 +1,14 @@ +[Unit] +Description=Balloon TX monolith +After=syslog.target network.target + +[Service] +PIDFile=/run/balloon_monolith.pid +ExecStart=/usr/bin/balloon_tx_monolith +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +PrivateTmp=true +User=balloon + +[Install] +WantedBy=multi-user.target diff --git a/debian/maintainer_scripts/postinst b/debian/maintainer_scripts/postinst new file mode 100644 index 0000000000000000000000000000000000000000..ca755ca4acef73daac6993499014607b9c621d18 --- /dev/null +++ b/debian/maintainer_scripts/postinst @@ -0,0 +1,4 @@ +adduser --system --system balloon +usermod -G gpio -a balloon +usermod -G spi -a balloon +setcap 'cap_sys_nice=eip' /usr/bin/balloon_tx_monolith \ No newline at end of file