diff --git a/Cargo.toml b/Cargo.toml index d110e9e..e94c319 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,14 +31,14 @@ extended-description = """ silod is a minimal Rust daemon for embedded Linux that listens to kernel uevents from the TS-SILO super-capacitor driver. It applies user-specified charging limits, runs hook scripts on power events, and initiates a clean -shutdown when capacity reaches a critical threshold. +shutdown when power has failed and capacity is below a critical threshold. """ section = "utils" priority = "optional" systemd-units = { enable = true, restart-after-upgrade = true } assets = [ - ["target/release/silod", "usr/bin/", "755"], + ["target/release/silod", "usr/sbin/", "755"], ["silo.toml.example", "etc/silod/silo.toml", "644"], ] conf-files = ["/etc/silod/silo.toml"] diff --git a/debian/service b/debian/service index 967414c..78d5295 100644 --- a/debian/service +++ b/debian/service @@ -4,7 +4,7 @@ After=multi-user.target [Service] Type=simple -ExecStart=/usr/bin/silod +ExecStart=/usr/sbin/silod Restart=always User=root Group=root diff --git a/src/supply.rs b/src/supply.rs index eb327c0..fa20cf1 100644 --- a/src/supply.rs +++ b/src/supply.rs @@ -158,7 +158,7 @@ impl Supply { let res = self.sysfs_write_u32(key, value); self.log_attr_result(key, value, res); } else if let Some(startup_charge_current_pct) = cfg.startup_charge_current_pct { - let max_ma = self.sysfs_read_u32("charge_current_max")?; + let max_ma = self.sysfs_read_u32("constant_charge_current_max")?; let key = "startup_charge_current_ma"; let value = (startup_charge_current_pct.saturating_mul(max_ma) / 100).clamp(0, max_ma); let res = self.sysfs_write_u32(key, value);