简体   繁体   English

将Python应用程序作为debian包分发,但作为服务

[英]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/rulesdebian/controldebian/changelog (您需要根据项目更改controlchangelog )。

Check the Debian New Maintainers' Guide for more detailed instructions. 有关更详细的说明,请查看Debian New Maintainers'指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 应用程序在 Raspbian Bullseye 上不起作用 - Debian package of Python Application not working on Raspbian Bullseye 分发python应用程序 - Distributing a python application 分发python应用程序教程 - Distributing python application tutorials 分发python应用程序 - Distributing python application 如何分发Python包(只需在子包中分发一些模型) - How to distributing a Python package(just distributing some model in sub package) 如何将 package Python GUI 应用程序转换为 Debian package 以在基于 debian 的操作系统或任何其他 linux 系统上运行? - How to package Python GUI application into Debian package to run on debian based operating system or any other linux systems? 从运行 fedora 的系统为我的 python 应用程序创建一个 debian 包 - Creating a debian package for my python application from a system running fedora 使用应用程序分发最小的python安装 - Distributing minimal python installation with application 有没有标准的方法来创建用于分发 Python 程序的 Debian 软件包? - Is there a standard way to create Debian packages for distributing Python programs? 使用安装工具分发python软件包 - Distributing python package using setup tools
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM