Revision 614244bd lib/utils.py
b/lib/utils.py | ||
---|---|---|
2237 | 2237 |
def WritePidFile(pidfile): |
2238 | 2238 |
"""Write the current process pidfile. |
2239 | 2239 |
|
2240 |
The file will be written to L{constants.RUN_GANETI_DIR}I{/name.pid} |
|
2241 |
|
|
2242 |
@type name: str |
|
2243 |
@param name: the daemon name to use |
|
2244 |
@param pid: if passed, will be used instead of getpid() |
|
2245 |
@raise errors.GenericError: if the pid file already exists and |
|
2240 |
@type pidfile: sting |
|
2241 |
@param pidfile: the path to the file to be written |
|
2242 |
@raise errors.LockError: if the pid file already exists and |
|
2246 | 2243 |
points to a live process |
2244 |
@rtype: int |
|
2245 |
@return: the file descriptor of the lock file; do not close this unless |
|
2246 |
you want to unlock the pid file |
|
2247 | 2247 |
|
2248 | 2248 |
""" |
2249 | 2249 |
# We don't rename nor truncate the file to not drop locks under |
Also available in: Unified diff