AutoService
一个简单高效的 systemd 服务管理工具。
痛点
- systemd 服务创建流程繁琐,需要手动编写配置文件
- 不同类型程序(Python、Shell等)的服务配置方式不同
- 服务管理命令分散,使用不便
解决方案
- 自动生成标准化的服务配置文件
- 智能识别命令类型,自动适配不同运行环境
- 统一的命令行接口管理全部服务
使用效果
# 创建服务(自动处理配置文件)
sudo autoservice create my-app "python app.py"
# 支持 Python 虚拟环境
sudo autoservice create venv-app "poetry run python app.py"
# 查看服务状态
sudo autoservice list
my-app: 🟢 运行中
venv-app: ⚫ 已停止
# 实时查看日志
sudo autoservice logs my-app -f
# 服务管理
sudo autoservice start my-app
sudo autoservice stop my-app
sudo autoservice restart my-app
sudo autoservice remove my-app
安装
sudo pip install autoservice
功能特点
- 支持创建、启动、停止、重启和删除 systemd 服务
- 自动适配不同类型的命令(Python、Shell 等)
- 自动检测 Python 虚拟环境
- 简单易用的命令行界面
使用方法
创建服务
sudo autoservice create <服务名> <命令>
Release files for autoservice 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autoservice-0.1.3.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoservice-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / autoservice-0.1.3.tar.gz
| Download URL | autoservice-0.1.3.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7496619bbe09953a16c0ce18392bfb32c6da60aafeef2fb9012a5e167fa28824
|
|
BLAKE2b-256 checksum How to use checksums |
9d6146c41e4f9520316470aa3aa2701b4437d1d159f7a0356d4b16dfa5a958f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2025.
Transparency logRelease files / autoservice-0.1.3-py3-none-any.whl
| Download URL | autoservice-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3225114cb22eab755fcd1b4ad5e08bbddf3137ed5c24a87ee4a0dee4be536b3a
|
|
BLAKE2b-256 checksum How to use checksums |
1c70634b437990aa81bd0567703f8cffa8e8ff8d64c9bdf579c4d6829b763e2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2025.
Transparency log