Opened 9 months ago

Last modified 9 months ago

#67991 assigned defect

apcupsd @3.14.14_2: Should not autostart

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: stephenreay (Stephen Reay)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: apcupsd

Description

I logged in to the buildbot workers today and was surprised to see a new icon at the right of the menubar that I didn't recognize. It was from apcupsd, whose portfile uses startupitem.autostart yes, which causes the program to launch when the port is activated.

Users don't expect installing a port to run software. And the notes of the port's usb variant say an additional command must be run by the user before the software will be fully functional, so the user will probably want to run that command and then start the software, not the other way around.

Additionally, on some buildbot workers, activation failed at the point where it tried to open the program, e.g.:

https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/241290/steps/install-port/logs/stdio

DEBUG: Executing proc-post-org.macports.activate-activate-0
DEBUG: system: open /Applications/MacPorts/apcagent.app
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/MacPorts/apcagent.app.
Command failed: open /Applications/MacPorts/apcagent.app
Exit code: 1
Error: Failed to activate apcupsd: command execution failed

Despite this error and the consequent activation failure, the program did open, which is confusing.

Please remove startupitem.autostart yes. Since this changes installed files, the revision must be increased as well.

Change History (2)

comment:1 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: apcupsd @ 3.14.14_2: Should not autostartapcupsd @3.14.14_2: Should not autostart

comment:2 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Actually I see the launching of the app that creates the menu item is a separate thing that was just added to the port today with this code in the post-activate block:

   # Start the Agent so the LoginItem is added
   system "open ${applications_dir}/apcagent.app"

so please remove that as well. And I see based on the comment and by confirming on the buildbot machines that this has added an entry to the user's login items. So please figure out how to programmatically remove that from the login items again, and add that code to the portfile too, probably hooked up to both port unload and port deactivate. Ports should not be changing the user's computer settings.

Remember to ensure that sudo port load apcupsd starts whatever needs to be started and that sudo port unload apcupsd stops whatever was started. We don't want a port's programs still running after the port has been unloaded, deactivated, or uninstalled.

Note: See TracTickets for help on using tickets.