Ticket #14223 (new defect)
port upgrade overwrites the user's launchd plists
| Reported by: | vinc17@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts Future |
| Component: | base | Version: | 1.6.0 |
| Keywords: | Cc: | ||
| Port: |
Description
After upgrading p5-mail-spamassassin, my /Library/LaunchDaemons/org.macports.spamd.plist file has been overwritten. This is a config file and the port shouldn't undo the user's changes.
Change History
comment:2 Changed 5 years ago by vinc17@…
The file is under /opt/local/etc/ thus it is a config file, like all files in /opt/local/etc/. If the user mustn't modify it, the file should be somewhere else, and the symbolic link /Library/LaunchDaemons/org.macports.spamd.plist should not be created (otherwise the user can't create his own plist file as there would be two plist files for the same service, which is very bad).
comment:3 follow-up: ↓ 4 Changed 5 years ago by dluke@…
Having two plist files (or 100) there for the same service doesn't break anything, especially since the ones installed by macports are not active.
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 5 years ago by vinc17@…
Since it is not active, there is no need to install it, and having it installed can confuse the user. If this is just for an example, then it should be under the documentation directory.
comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 5 years ago by dluke@…
Replying to vinc17@macports.org:
Since it is not active, there is no need to install it,
It is installed to enable the end user to easily 'activate' the automatic startup (launchctl load -w foo.plist). The way the current startupitem code works, the plist will be recreated/replaced upon upgrade.
The plists that are generated should be sufficient for people's needs, but if you wanted to use it as a base for a plist that does something differently, that would be reasonable as well.
Perhaps we should update the documentation to make this more clear?
In any event, it's not a bug for this particular port (it's either a documentation bug, or a base bug).
comment:6 in reply to: ↑ 5 Changed 5 years ago by vinc17@…
Replying to dluke@macports.org:
It is installed to enable the end user to easily 'activate' the automatic startup (launchctl load -w foo.plist).
But the launchctl load -w foo.plist is not remembered after a reboot. So, I don't think this is easy. Also, if the user wants to do launchctl load -w foo.plist, I suppose he can still do it if the plist is in the doc directory (or in some other directory that makes clear that the files must not be modified by the user).
The way the current startupitem code works, the plist will be recreated/replaced upon upgrade.
The replace script should be able to detect when the file has been modified. The current solution is broken. BTW, there has been a similar discussion in the macports-dev (Updating macports.conf).
Perhaps we should update the documentation to make this more clear?
The current way is still confusing as it breaks conventions.
In any event, it's not a bug for this particular port (it's either a documentation bug, or a base bug).
Yes, perhaps a base bug.
comment:7 Changed 5 years ago by simon@…
- Cc vinc17@… removed
- Milestone changed from Port Bugs to MacPorts base bugs
Moving to base bugs.
comment:8 Changed 4 years ago by toby@…
- Milestone changed from MacPorts base bugs to MacPorts Future
Milestone MacPorts base bugs deleted
comment:10 Changed 4 years ago by toby@…
- Summary changed from p5-mail-spamassassin upgrade overwrites the user's /Library/LaunchDaemons/org.macports.spamd.plist to port upgrade overwrites the user's launchd plists


It's not a config file, it's the automatically generated startup item (which happens to be a launchd plist in this case).
Perhaps we should document that you shouldn't modify it?
You can always not enable the macports-provided one and create your own plist based off of it and use it instead.