Opened 14 years ago

Closed 13 years ago

#26623 closed defect (duplicate)

couchdb @1.0.1 does not install plist when /Library/LaunchDaemons does not exist

Reported by: llyodall@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: mikhail.sobolev@…
Port: couchdb

Description (last modified by ryandesign (Ryan Carsten Schmidt))

This is bad because in general I have been able to uninstall and install other MacPort efficiently and effectively. I didn't expect my /Library/LaunchDaemons directory to completely disappear on the Uninstall of couchdb @1.0.1

This is what I tried:

shell > sudo port install couchdb
shell > sudo port uninstall couchdb
shell > sudo port install couchdb

ERROR strings that print on "re-install"

......
Error: reinplace: couldn't read file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/work/destroot/opt/local/Library/LaunchDaemons/org.apache.couchdb.plist":
no such file or directory
.....

WORKAROUND

shell > sudo mkdir
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/work/destroot/opt/local/Library/LaunchDaemons
shell > sudo touch
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/work/destroot/opt/local/Library/LaunchDaemons/org.apache.couchdb.plist
shell > sudo port install couchdb

/* this will succeed, however DO NOT run the launchctl yet /

NOTE: the org.apache.couchdb.plist is created but there is no data. We need to add the PLIST data for launchctl.

shell > sudo vi /Library/LaunchDaemons/org.apache.couchdb.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>org.apache.couchdb</string>
  <key>EnvironmentVariables</key>
  <dict>
    <key>HOME</key>
    <string>~</string>


  </dict>
  <key>ProgramArguments</key>
  <array>
    <string>/opt/local/bin/couchdb</string>
  </array>
  <key>UserName</key>
  <string>couchdb</string>
  <key>StandardOutPath</key>
  <string>/dev/null</string>
  <key>StandardErrorPath</key>
  <string>/dev/null</string>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
</dict>
</plist>

NOTE: Now execute the launchtctl command from the message of the couchdb successful install.

shell > sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist
shell > curl http://127.0.0.1:5984
{"couchdb":"Welcome","version":"1.0.1"}

Perhaps the install procedure needs to be a little bit proactive in creating directories if they do not exist.

{ :-) (happy (coding)) }

Jonathan

Change History (6)

comment:1 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to jwa@…
Port: couchdb added

Please remember to use WikiFormatting and to fill in the Port and Cc fields.

AFAIK the install procedure is plenty proactive about creating all needed directories. Not sure yet what went wrong in your case.

comment:2 Changed 14 years ago by llyodall@…

I am still not sure what happened. All I know is that /Library/LaunchDaemons/ was no longer existing. Perhaps the installer script can do a quick test to see if the directory /Library/LaunchDaemons still exists if it does not just simply create one with a mkdir command before it creates a symbolic link

Make sure this directory exists.

shell > mkdir /Library/LaunchDaemons 

Now create symbolic link inside /Library/LaunchDaemons/ directory

shell > cd /Library/LaunchDaemons
shell > ln -s /opt/local/Library/LaunchDaemons/org.apache.couchdb.plist org.apache.couchdb.plist 

This is just a suggestion for the logic of a fix.

{ ":-)", "happy", "coding" }

Jonathan

comment:3 Changed 13 years ago by mikhail.sobolev@…

Cc: mikhail.sobolev@… added

Cc Me!

comment:4 Changed 13 years ago by mikhail.sobolev@…

For what it's worth, I experienced the same problem and, unfortunately, the workaround does not really work for me.

I'd be happy to provide any additional information to help to fix it, as I really need couchdb for my experiments.

comment:5 Changed 13 years ago by mikhail.sobolev@…

Just to make it clear what did not work:

$ curl http://127.0.0.1:5984
curl: (7) couldn't connect to host

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

Resolution: duplicate
Status: newclosed
Summary: couchdb @1.0.1 may corrupt launchctl files for "re-install"couchdb @1.0.1 does not install plist when /Library/LaunchDaemons does not exist

/Library/LaunchDaemons being removed when empty was #27920. It appears that couchdb's configure script disables installation of the plist when that directory does not exist at configure time. That's probably less than ideal behaviour, but creating a directory outside the work dir is not an acceptable fix.

Note: See TracTickets for help on using tickets.