You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "cesine (JIRA)" <ji...@apache.org> on 2015/02/11 04:19:13 UTC

[jira] [Created] (COUCHDB-2575) LaunchDaemons org.apache.couchdb.plist results in error erlexec: HOME must be set

cesine created COUCHDB-2575:
-------------------------------

             Summary: LaunchDaemons org.apache.couchdb.plist  results in error erlexec: HOME must be set
                 Key: COUCHDB-2575
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2575
             Project: CouchDB
          Issue Type: Question
      Security Level: public (Regular issues)
            Reporter: cesine


Environment:
* SSHed remotely into a Yosemite OSX machine, 
* installed couchdb 1.6.1 from brew

Goal
* [follow the couchdb instructions | http://docs.couchdb.org/en/latest/install/mac.html] to start the daemon on boot

The [current brew formula | https://github.com/Homebrew/homebrew/commit/75bdc45396e9735257ca5086b8e93bc14a71846e#diff-36398e80f278468f8fd1c1a49fa51325L49] deletes the original plist. So, lets try to reconstruct the plist that we are supposed to copy. 
*  [couchdb repo | https://github.com/apache/couchdb/blob/1.6.x/etc/launchd/org.apache.couchdb.plist.tpl.in]
* googling results in only very old versions  [2009 |  https://github.com/cloudant/couch/blob/master/etc/launchd/org.apache.couchdb.plist.tpl.in] 
* and  [2010 | http://apple.stackexchange.com/questions/590/launchdaemon-not-recognised]

/Library/LaunchDaemons/org.apache.couchdb.plist
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>/usr/local/var/lib/couchdb</string>


    </dict>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/couchdb</string>
    </array>
    <key>UserName</key>
    <string>couchdb</string>


    <key>StandardOutPath</key>
    <string>/usr/local/var/log/couchdb/couchdb_launchd_out.log</string>
    <key>StandardErrorPath</key>
    <string>/usr/local/var/log/couchdb/couchdb_launchd_error.log</string>

    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
  </dict>
</plist>
{code}


{code:bash}
# couchdb user and group are created:
$ dscacheutil -q group | grep couchdb
name: couchdb
users: couchdb cesine 
users: root couchdb

# couchdb's home is set to /usr/local/var/lib/couchdb
$ sudo su couchdb
$ cd
$ pwd
/usr/local/var/lib/couchdb
$ exit

# start the plist:
$ sudo launchctl load /Library/LaunchDaemons/org.apache.couchdb.plist
$ sudo launchctl start org.apache.couchdb.plist
$ cat  /usr/local/var/log/couchdb/couchdb_launchd_error.log
erlexec: HOME must be set 
...
# repeated 320+ times 
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)