Opened 5 years ago
Closed 2 years ago
#60273 closed defect (fixed)
mail-server installs /Library/LaunchDaemons/org.macports.logrotate.plist not registered to port
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | essandess (Steve Smith) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.2 |
Keywords: | Cc: | ||
Port: | mail-server |
Description
I discovered the unexpected file /Library/LaunchDaemons/org.macports.logrotate.plist on our buildbot workers and traced it back to the mail-server port. It is unexpected that a port would install a launchd plist that is not registered to the port and that is therefore not automatically removed when the port is uninstalled. Why does it do this? Do you expect the user to edit this plist?
Change History (7)
comment:1 Changed 5 years ago by essandess (Steve Smith)
comment:2 Changed 5 years ago by essandess (Steve Smith)
Wait, port logrotate
provides /opt/local/share/logrotate/org.macports.logrotate.plist.example
but doesn’t do anything with it.
What would be the recommended way to use this launch daemon example provided by one port as part of a different port?
We definitely want to rotate logs in mail-server
because of the large number of various logs, and the logrotate
example works perfectly for this.
comment:3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)
Can you have the mail-server port install a differently-named plist: org.macports.mail-server.logrotate.plist for example?
Since mail-server depends on logrotate, any files installed by logrotate including that example plist will be there when the mail-server port is being built. If you really want to, you can have the port copy that example plist into your destroot and modify it. But it seems like it would be simpler to just have your own copy of the plist in the files directory with whatever modifications you need. For example, perhaps you want your copy of the plist to use a different logrotate conf file so that you don't interfere with a user's existing logrotate conf file.
comment:4 Changed 5 years ago by essandess (Steve Smith)
comment:5 Changed 4 years ago by essandess (Steve Smith)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The file /Library/LaunchDaemons/org.macports.logrotate.plist is still present on buildbot worker machines (and likely on the machines of any users who installed the port), so you haven't successfully modified the port to clean this up. The usual way to clean up these kinds of mistakes is to add a pre-activate block that deletes the offending file and keep that block in place for one year to allow users time to upgrade. See the xdiskusage port for an example.
comment:7 Changed 2 years ago by essandess (Steve Smith)
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks. My dumb mistake. I’ll fix this by adding a startupitem and having this properly destrooted.
Offending Portfile code: