TamtamHero / fw-fanctrl

A simple systemd service to better control Framework Laptop's fan(s)
BSD 3-Clause "New" or "Revised" License
178 stars 33 forks source link

install.sh attempts to stop service during packaging #40

Closed icedream closed 3 months ago

icedream commented 3 months ago

Describe the bug The installation script attempts to assume control over the systemd services it installs by trying to stop them if they are running. This is fine for systems directly calling the install script, though it introduces issues during AUR package build. It is a better idea to have this happen in post-install, and for the AUR package this does not make sense anyways until the actual package installation runs (where pacman's hooks manage the systemd services).

To Reproduce Steps to reproduce the behavior:

  1. Build the package with a previous version of fw-fanctrl already installed and actively running
  2. Wait for the packaging process to call install script.

Expected behavior It should copy the files and create the package successfully without touching any host services.

Error message

==> Starting package()...
creating '/home/icedream/Documents/Source/Git/aur.archlinux.org/fw-fanctrl-git/pkg/fw-fanctrl-git/usr/lib/systemd/system'
creating services
stopping [fw-fanctrl]
Failed to stop fw-fanctrl.service: Access denied
See system logs and 'systemctl status fw-fanctrl.service' for details.

This also pops up a graphical request to allow access to the host systemd.

Environment (please complete the following information):

leopoldhub commented 3 months ago

Hi @icedream , how are you doing? I have just created a PR #41 to fix this issue, could you please test if this solves your problem when you have some time? Have a great day