create_pidlock
Create and verify pidfile.
If the pidfile already exists the program exits with an error message,
however if the process it refers to isn't running anymore, the pidfile
is deleted and the program continues.
This function will automatically install an :mod:`atexit` handler
to release the lock at exit, you can skip this by calling
:func:`_create_pidlock` instead.
def create_pidlock(
pidfile: string
) - > Pidfile
Create and verify pidfile. If the pidfile already exists the program exits with an error message, however if the process it refers to isn't running anymore, the pidfile is deleted and the program continues. This function will automatically install an :mod:atexit handler to release the lock at exit, you can skip this by calling :func:_create_pidlock instead.
Parameters
| Name | Type | Description |
|---|---|---|
| pidfile | string | The file system path where the PID file will be created to manage the process lock. |
Returns
| Type | Description |
|---|---|
Pidfile | Pidfile: used to manage the lock. |