Best approach to writing a generic installer for a Linux application?

后端 未结 5 810
走了就别回头了
走了就别回头了 2021-02-03 12:24

We have a Linux server application that is comprised of a number of open-source tools as well as programs we\'ve written ourselves. Ideally we would like to be able to install t

5条回答
  •  清酒与你
    2021-02-03 12:57

    I believe that most of the tasks which you describe are fairly standardized between Linux distros. In my experience, the following should work the Debian family (including Ubuntu) and the Red Hat family (including Fedora and CentOS):

    • Create user / group accounts - adduser command
    • Create directory trees - mkdir or install, or just expand a tarball
    • Install open source applications - Unless you have particularly esoteric needs, this should probably be left to the distro's package manager.
    • Install files - install, or just expand a tarball
    • Startup and shutdown scripts - install to /etc/init.d then symlink to /etc/rc*.d

    VMware Server is freely available for Linux and does most of the tasks which you describe. It uses Perl and maybe shell for its installation and configuration, so you might see the approach that it takes.

    However, speaking as a Linux admin, I strongly prefer applications that integrate with my package management system. In other words, create .deb and .rpm files, as Vinko Vrsalovic suggested. Building packages is extremely well documented:

    • Building RPMs for Fedora (or Red Hat or CentOS): draft documentation, RPM Guide
    • Building .debs for Debian (or Ubuntu): Debian Maintainer's Guide

提交回复
热议问题