[英]Distributing Python application as a debian package, but as service
Hello I'm trying to create a debian package for my application, well this is th structure: 您好我正在尝试为我的应用程序创建一个debian包,这是结构:
Project
|start.py
|ProyectPackage2/...
|ProyectPackage1/...
|DataExtra/...
|Settings/service.cfg
When I want to run my app I write: 当我想运行我的应用程序时,我写道:
python start.py
python start.py
and it works. 它的工作原理。
but I want to distribute my app in a debian package and I want the following: 但我想在debian包中分发我的应用程序,我想要以下内容:
1- After installing debian package I want have a new command into /usr/sbin/ like my_service 1-安装debian软件包后,我想在/ usr / sbin / like my_service中添加一个新命令
2- Extra Content must located into /usr/lib/my_service/extracontent 2- Extra Content必须位于/ usr / lib / my_service / extracontent中
3- Service must run when package were installed 3-安装软件包时必须运行服务
I have tried 我努力了
python stdeb
python stdeb
and it create a debian structure for packaging but, i'd like add script to do: create command, copy content, service install. 它创建了一个包装的debian结构,但是,我想添加脚本来做:创建命令,复制内容,服务安装。
Thanks in advance. 提前致谢。
In your debian/
folder, you need the following files to solve your problem: 在您的
debian/
文件夹中,您需要以下文件来解决您的问题:
init with your init script. 初始化与你的初始化脚本。 This file will be installed to
/etc/init.d/myservice
and will be started automatically at boot. 该文件将安装到
/etc/init.d/myservice
,并将在启动时自动启动。 You can (and should) use /etc/init.d/skeleton
as a template for your init script. 您可以(并且应该)使用
/etc/init.d/skeleton
作为init脚本的模板。
install with a list of files to be installed, along with target directories. 安装一个要安装的文件列表以及目标目录。 For example
例如
DataExtra/* usr/lib/my_service/extracontent
might fit your project. 可能适合你的项目。 Check the manual page of
dh_install
. 查看
dh_install
的手册页。
Other files that you need are debian/rules
, debian/control
and debian/changelog
(you need to change control
and changelog
according to your project). 您需要的其他文件是
debian/rules
, debian/control
和debian/changelog
(您需要根据项目更改control
和changelog
)。
Check the Debian New Maintainers' Guide for more detailed instructions. 有关更详细的说明,请查看Debian New Maintainers'指南 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.