init script incorrectly 'su's

Bug #435484 reported by Herb McNew on 2009-09-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
couchdb (Ubuntu)
Chad Miller

Bug Description

Binary package hint: couchdb

If the init script is run as the COUCHDB_USER it still attempts to su to the COUCHDB_USER. This doesn't work. The script should check to see if it's already COUCHDB_USER before trying to su.

Alex Lourie (alourie) wrote :


Thank you for taking the time to report this bug and helping to make Ubuntu better.

Can you please be more specific? What do you mean by "doesn't work"? Do you get an error while starting it?
I've checked the init script, and it is perfectly normal to run su $USER being already a $USER.

Changed in couchdb (Ubuntu):
status: New → Incomplete
Herb McNew (herb) wrote :

If you run su as $USER the su process will either a) prompt you for a password (if one is set) or b) return "su: Permission denied" if the password field is a *. Either way this blocks the startup of the process or the machine.

Example a:
herb@ramble:~$ id
uid=1000(herb) gid=1000(herb) groups=1000(herb)
herb@ramble:~$ su herb

Example b:
couchdb@ramble:~$ id
uid=111(couchdb) gid=120(couchdb) groups=120(couchdb)
couchdb@ramble:~$ su couchdb
su: Permission denied

Changed in couchdb (Ubuntu):
status: Incomplete → New


You are correct; this would be a problem if the script would run by anyone
but root.

But is it executed as non-root user? Ever?

  status confirmed

Hash: SHA1

Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Use GnuPG with Firefox : (Version: 0.7.8)


Changed in couchdb (Ubuntu):
status: New → Confirmed
Herb McNew (herb) wrote :

It is run as a non-root user. That's how we found this bug. On our production systems we on occasion give people access to certain role accounts, but don't want them to have root access. This includes the ability to start and stop services associated with said role accounts. In particular some members of our team have access to the COUCHDB_USER account and couldn't restart the service despite the fact they were operating as the process owner.

Chad Miller (cmiller) on 2009-10-02
Changed in couchdb (Ubuntu):
assignee: nobody → Chad Miller (cmiller)
Chad Miller (cmiller) on 2009-10-02
Changed in couchdb (Ubuntu):
status: Confirmed → In Progress
Chad Miller (cmiller) on 2009-10-16
Changed in couchdb (Ubuntu):
status: In Progress → Confirmed
Jonathan Davies (jpds) on 2009-12-08
Changed in couchdb (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
status: In Progress → Confirmed
Chad Miller (cmiller) wrote :

Reported upstream at

(LP does not track JIRA tickets yet.)

Tom Haddon (mthaddon) on 2010-05-28
tags: added: canonical-losa-u1
Steve Langasek (vorlon) wrote :

init scripts should never call su. They should call start-stop-daemon instead.

Changed in couchdb (Ubuntu):
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers