Arnavion / tpfancontrol-rs

Temperature and fan controller for Thinkpads on Linux
27 stars 2 forks source link

Run on start using systemd #5

Closed Kobtul closed 3 years ago

Kobtul commented 3 years ago

I have created systemd service:

[Unit]
Description=tpfancontrol-rs

[Service]
Type=oneshot
User=root
Environment="RUST_BACKTRACE=1"
ExecStart=/home/kobi/github/tpfancontrol-rs/target/release/tpfancontrol &

[Install]
WantedBy=multi-user.target

however service fails with:

● tpfancontrol-rs.service - tpfancontrol-rs
     Loaded: loaded (/etc/systemd/system/tpfancontrol-rs.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-03-15 11:54:24 CET; 5min ago
    Process: 65399 ExecStart=/home/kobi/github/tpfancontrol-rs/target/release/tpfancontrol & (code=exited, status=101)
   Main PID: 65399 (code=exited, status=101)

bře 15 11:54:24 pop-os tpfancontrol[65399]:    2: core::result::unwrap_failed
bře 15 11:54:24 pop-os tpfancontrol[65399]:              at ./build/rustc-n7HJ8w/rustc-1.47.0+dfsg1+llvm/library/core/src/result.rs:1220
bře 15 11:54:24 pop-os tpfancontrol[65399]:    3: cursive::backend::termion::Backend::init
bře 15 11:54:24 pop-os tpfancontrol[65399]:    4: cursive::cursive::Cursive::termion
bře 15 11:54:24 pop-os tpfancontrol[65399]:    5: tpfancontrol::main
bře 15 11:54:24 pop-os tpfancontrol[65399]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
bře 15 11:54:24 pop-os tpfancontrol[65399]: [6B blob data]
bře 15 11:54:24 pop-os systemd[1]: tpfancontrol-rs.service: Main process exited, code=exited, status=101/n/a
bře 15 11:54:24 pop-os systemd[1]: tpfancontrol-rs.service: Failed with result 'exit-code'.
bře 15 11:54:24 pop-os systemd[1]: Failed to start tpfancontrol-rs.

Can you please help me to run the binary at boot using systemd?

Arnavion commented 3 years ago

It's a TUI. It can't run headless. It needs to run on an actual tty.