~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/doc/pidfile.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-06 12:11:50 UTC
  • mfrom: (14625.2.7 gina-dsc-binaries)
  • Revision ID: launchpad@pqm.canonical.com-20120106121150-e0bucmb5qeyytnn9
[r=wgrant][bug=911943] Fix SourcePackageReleaseDscBinariesUpdater:
        round chunk_size to int (and document this issue).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
`pidfile_path` is the key to all four of them. Usually, you simply pass it the
18
18
name of a service. It then gets the configured name for the current instance
19
 
from `canonical.config.config`, and returns a pidfile path that combines the
 
19
from `lp.services.config.config`, and returns a pidfile path that combines the
20
20
instance name with the service name.
21
21
 
22
 
    >>> from canonical.lazr.pidfile import (
 
22
    >>> from lp.services.pidfile import (
23
23
    ...     pidfile_path, make_pidfile, remove_pidfile, get_pid)
24
 
    >>> from canonical.config import config
 
24
    >>> from lp.services.config import config
25
25
 
26
26
    >>> pidfile_path('nuts') == '/var/tmp/%s-nuts.pid' % config.instance_name
27
27
    True
55
55
 
56
56
    >>> cmd = '''
57
57
    ... import os.path, sys
58
 
    ... from canonical.lazr.pidfile import make_pidfile, pidfile_path
 
58
    ... from lp.services.pidfile import make_pidfile, pidfile_path
59
59
    ... make_pidfile('nuts')
60
60
    ... sys.exit(
61
61
    ...     int(open(pidfile_path('nuts')).read().strip() == str(os.getpid()))
78
78
    >>> import time
79
79
    >>> subprocess_code = '''
80
80
    ... import time
81
 
    ... from canonical.lazr.pidfile import make_pidfile
 
81
    ... from lp.services.pidfile import make_pidfile
82
82
    ... make_pidfile('nuts')
83
83
    ... try:
84
84
    ...     time.sleep(30)