remove --user and add sudo for systemctl calls

This commit is contained in:
glyph 2022-07-14 08:57:22 +01:00
parent 01138eef35
commit fcb17d6802
1 changed files with 4 additions and 4 deletions

View File

@ -44,8 +44,8 @@ impl SbotStat {
pub fn sbot_stats() -> Result<SbotStat, StatsError> { pub fn sbot_stats() -> Result<SbotStat, StatsError> {
let mut status = SbotStat::default(); let mut status = SbotStat::default();
let info_output = Command::new("/usr/bin/systemctl") let info_output = Command::new("sudo")
.arg("--user") .arg("systemctl")
.arg("show") .arg("show")
.arg("go-sbot.service") .arg("go-sbot.service")
.arg("--no-page") .arg("--no-page")
@ -66,8 +66,8 @@ pub fn sbot_stats() -> Result<SbotStat, StatsError> {
} }
} }
let status_output = Command::new("/usr/bin/systemctl") let status_output = Command::new("sudo")
.arg("--user") .arg("systemctl")
.arg("status") .arg("status")
.arg("go-sbot.service") .arg("go-sbot.service")
.output() .output()