Opened 16 years ago

Closed 7 years ago

Last modified 7 years ago

#14223 closed defect (duplicate)

port upgrade overwrites the user's launchd plists

Reported by: vinc17@… Owned by: macports-tickets@…
Priority: Normal Milestone:
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 (13)

comment:1 Changed 16 years ago by danielluke (Daniel J. Luke)

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.

comment:2 Changed 16 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 Changed 16 years ago by danielluke (Daniel J. Luke)

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 ; Changed 16 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 ; Changed 16 years ago by danielluke (Daniel J. Luke)

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 16 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 16 years ago by simon@…

Cc: vinc17@… removed
Milestone: Port BugsMacPorts base bugs

Moving to base bugs.

comment:8 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:9 Changed 15 years ago by tobypeterson

Component: portsbase

comment:10 Changed 15 years ago by tobypeterson

Summary: p5-mail-spamassassin upgrade overwrites the user's /Library/LaunchDaemons/org.macports.spamd.plistport upgrade overwrites the user's launchd plists

comment:11 Changed 14 years ago by simon@…

Owner: changed from simon@… to macports-tickets@…

comment:12 Changed 7 years ago by raimue (Rainer Müller)

Resolution: duplicate
Status: newclosed

Preserving configuration files across upgrades is tracked in #2365.

comment:13 Changed 7 years ago by jmroot (Joshua Root)

Milestone: MacPorts Future
Note: See TracTickets for help on using tickets.