/usr/share/pyshared/desktopcouch/application/stop_local_couchdb.py is in python-desktopcouch-application 1.0.8-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # Copyright 2009 Canonical Ltd.
#
# This file is part of desktopcouch.
#
# desktopcouch is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# desktopcouch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with desktopcouch. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Chad Miller <chad.miller@canonical.com>
# Stuart Langridge <stuart.langridge@canonical.com>
"""
Stop local CouchDB server.
"""
import subprocess
import sys
from desktopcouch.application import local_files
def stop_couchdb(ctx=local_files.DEFAULT_CONTEXT):
"""Stop the local couchdb."""
local_exec = ctx.couch_exec_command + ["-d"]
try:
retcode = subprocess.call(local_exec, shell=False)
if retcode < 0:
print >> sys.stderr, "Child was terminated by signal", -retcode
elif retcode > 0:
print >> sys.stderr, "Child returned", retcode
except OSError, e:
print >> sys.stderr, "Execution failed: %s: %s" % (e, local_exec)
exit(1)
if __name__ == "__main__":
stop_couchdb()
|