No project description provided
Project description
Wait PID Wrapper
Introduction
Start a process and store the process identifier in a pid file (wait-pid-wrapper-exec
).
The pid file then can be awaited until the process ends (wait-pid-wrapper-waitpid
).
This is useful for running a normal process as a service using SystemD, preventing it from running concurrently or running for infinity.
SystemD is capable of running processes as a service but it cannot gracefully timeout (AFAIK).
You can either set KillSignal
to something harmless or KillMode=none
but then SystemD doesn't timeout the process.
Usage
The following SystemD unit starts a sleep process with the following behavior:
command | is sleep running? | behavior |
---|---|---|
systemctl start mysleep | no | start sleep |
systemctl start mysleep | yes | sleep is already running |
systemctl stop mysleep | no | nothing happens, sleep is not running |
systemctl stop mysleep | yes | wait until sleep has finished, allow timeout to forcefully stop the process |
[Unit]
Description=My sleep
[Service]
Type=exec
ExecStart=waitpidwrapper-exec mysleep sleep 9999
ExecStop=waitpidwrapper-waitpid mysleep
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wait_pid_wrapper-0.1.0.tar.gz
.
File metadata
- Download URL: wait_pid_wrapper-0.1.0.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.5 Linux/6.10.6-200.fc40.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d13f20307da54fa3d4f4a2d2d6f72869ae1b9408d633fb5dbb5a5a5ae9b15d24 |
|
MD5 | 5461f75d6f6ce80e106f6165975f8b07 |
|
BLAKE2b-256 | 82dd34b7ffc48410e093efb8dce06b9774970245f56288e8a31b2a9dbc435a29 |
File details
Details for the file wait_pid_wrapper-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: wait_pid_wrapper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.5 Linux/6.10.6-200.fc40.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb630ef04cd7e0c33e335548f6f1d2f003324df0d6291581da5e4b72c9e150f |
|
MD5 | d41e37c1d559801e2775abb16449dc52 |
|
BLAKE2b-256 | 2d18d3821a7aefdb6350557d3b2d8863829d9cf9db8d9f57f7a93a5e1e285b12 |