CouchDB
  1. CouchDB
  2. COUCHDB-603

init script needlessly 'su's, and non-superuser use fails

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Infrastructure
    • Labels:
      None
    • Environment:

      Unix

    • Skill Level:
      New Contributors Level (Easy)

      Description

      The init script runs 'su' if the COUCHDB_USER variable is set, but it doesn't need to if the script is already running as that user. Add an additional condition on that test, so that normal role users can start and stop the server.

      — couchdb/etc/init/couchdb.tpl.in 2009-10-02 07:10:18.475913699 -0400
      +++ couchdb/etc/init/couchdb.tpl.in 2009-10-02 07:22:22.711911041 -0400
      @@ -77,7 +77,7 @@
      command="$command $COUCHDB_OPTIONS"
      fi
      mkdir -p "$RUN_DIR"

      • if test -n "$COUCHDB_USER"; then
        + if test -n "$COUCHDB_USER" -a "`id -u \"$COUCHDB_USER\" 2>&1`" != "`id -u`"; then
        chown $COUCHDB_USER "$RUN_DIR"
        if su $COUCHDB_USER -c "$command" > /dev/null; then
        return $SCRIPT_OK

      (Reported as bug at https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/435484 )

        Activity

        Jan Lehnardt made changes -
        Assignee Noah Slater [ nslater ]
        Sam Bisbee made changes -
        Hide
        Sam Bisbee added a comment -

        Looks good to me. Attaching a patch file for clean merging and to check the "Grant license to ASF" box.

        Related branch: COUCHDB-603 on github.com/sbisbee/couchdb

        Cheers.

        Show
        Sam Bisbee added a comment - Looks good to me. Attaching a patch file for clean merging and to check the "Grant license to ASF" box. Related branch: COUCHDB-603 on github.com/sbisbee/couchdb Cheers.
        Paul Joseph Davis made changes -
        Field Original Value New Value
        Skill Level New Contributors Level (Easy)
        Chad MILLER created issue -

          People

          • Assignee:
            Noah Slater
            Reporter:
            Chad MILLER
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development