Project

General

Profile

Actions

Bug #2602

closed

Debian packages: Install configs to /etc/osmocom/ + systemd .service files

Added by laforge over 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
10/29/2017
Due date:
% Done:

100%

Spec Reference:

Description

while working on the "osmocom:latest" builds the last few days, I noticed that some packages (notably osmo-pcu) install a config file to /etc/osmocom,
while most other packages simply install some example config files to /usr/share/doc/* and don't create either /etc/osmocom nor any config files
in it - despite the systemd jobs depending on it.

For sure, the behavior should be unified across all Osmocom packages, but in which way?

What is the best practise here? What do our users expect?


Related issues

Related to Cellular Network Infrastructure - Bug #2620: Testing NITB Migration GuideRejectedroh11/07/2017

Actions
Actions #1

Updated by lynxis over 6 years ago

I would expect a "working" configuration. So everything is connecting to each other. As BTS we could either configure an example sysmobts or use virtual-phy.

Actions #2

Updated by lynxis over 6 years ago

  • Related to Bug #2620: Testing NITB Migration Guide added
Actions #3

Updated by lynxis over 6 years ago

  • Subject changed from Debian packages: Instal configs to /etc/osmocom/ or not? to Debian packages: Install configs to /etc/osmocom/ or not?
Actions #4

Updated by laforge over 5 years ago

  • Subject changed from Debian packages: Install configs to /etc/osmocom/ or not? to Debian packages: Install configs to /etc/osmocom/ + systemd .service files
  • Assignee changed from laforge to pespin
  • Priority changed from Low to High

I agree, we should install our default configs (expecting everything on localhost) and install systemd .service files.

I think we should not automatically start the services, i.e. no "systemctl enable" so users can chose for themselves when to run them or whether to automatically start them at system boot.

Actions #5

Updated by pespin over 5 years ago

A bit of summary of stuff required.

For each project here:

libosmo-sccp
osmo-iuh
osmo-hlr
osmo-ggsn
osmo-sgsn
osmo-mgw
osmo-msc
osmo-bsc
osmo-bts
osmo-pcu
osmo-trx
osmo-sip-connector
openbsc

Make sure:
  • systemd files for all daemon-alike binaries are included in the git repo and shipped in a debian package. Do so by linking .service file to debian/.service.
  • Make sure a sample config file is provided in both /usr/share/doc and /etc/osmocom (and make sure the /etc file matches the -C param in systemd file). Do so by installing them through autotools, then assign the file in debian/*.install files.
  • Update OE recipes accordingly in laforge/nightly.

As per "make sure systemd services are not enabled by default", I recall reading they were not, but I'll do some tests to confirm.

Regarding config files, it seems there exists "debian/conffiles" [1,2], but according to [3] it may be easier to enable dh_installdeb if it's not already:

5.3. conffiles

One of the most annoying things about software is when you spend a great deal of time and effort customizing a program, only to have an upgrade stomp all over your changes. Debian solves this problem by marking such configuration files as conffiles. When you upgrade a package, you'll be asked whether you want to keep your old configuration files or not.

dh_installdeb(1) automatically flags any files under the /etc directory as conffiles, so if your program only has conffiles there you do not need to specify them in this file. For most package types, the only place conffiles should ever be is under /etc, and so this file doesn't need to exist. 

[1] http://man7.org/linux/man-pages/man5/deb-conffiles.5.html
[2] https://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html
[3] https://www.debian.org/doc/manuals/maint-guide/dother.en.html

Actions #6

Updated by pespin over 5 years ago

I did some tests and indeed systemd services are not enabled/started by default, so no need to do any changes related to that.

Actions #7

Updated by pespin over 5 years ago

With last bunch of patches I pushed to different projects, systemd services on debian packages should be all done.

We should actually install systemd services during "make install" time. Follow link section "Installing systemd Service File" explains how to do it: https://www.freedesktop.org/software/systemd/man/daemon.html

Actions #8

Updated by pespin over 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

Patches for mentioned osmocom projects installing system service files from autotools have been pushed.

Now only .cfg relatd stuff is missing.

Actions #9

Updated by pespin over 5 years ago

I did some tests in a debian system iwth osmo-pcu, which already installs /etc/osmocom/osmo-pcu.cfg.
I installed it, then removed it and .cfg file is left there. I modified some lines. Then I installed osmo-pcu again, and modified .cfg file is kept, so it seems dh_installdeb is handling it correctly as a cfg file.

In the event we have something in /etc/ we don't want to handle as a config file, a symlink needs to be created from /var:

    If the program you're packaging requires every user to modify the configuration files in the /etc directory, there are two popular ways to arrange for them to not be conffiles, keeping dpkg quiet:

    Create a symlink under the /etc directory pointing to a file under the /var directory generated by the maintainer scripts.

    Create a file generated by the maintainer scripts under the /etc directory.

So what's missing now, is making sure all projects needing it install a sane .cfg file into /etc/osmocom.

Actions #10

Updated by pespin over 5 years ago

  • % Done changed from 50 to 70

I wrote patches to install /etc/osmocom/*.cfg stuff and I'm building changes now with OBS. I'll probably submit them tomorrow.

Actions #11

Updated by pespin over 5 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 70 to 90

All patches are submitted now in gerrit.

Actions #12

Updated by pespin over 5 years ago

Missing once merged: Update OE recipes.

Actions #13

Updated by pespin over 5 years ago

Related OE changes for meta-telephony laforge/nightly pushed to gerrit for review:

remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10948 libosmo-sccp: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10949 osmo-iuh: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10950 osmo-hlr: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10951 osmo-ggsn: Drop untested sysvinit support
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10952 osmo-ggsn: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10953 osmo-sgsn: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10954 osmo-mgw: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10955 osmo-msc: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10956 osmo-bsc: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10957 osmo-sip-connector: handle systemd and cfg files through autotools
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10958 openbsc: Drop untested sysvinit support
remote:   https://gerrit.osmocom.org/#/c/meta-telephony/+/10959 openbsc: handle systemd and cfg files through autotools

Patches for osmo-bts and osmo-pcu in meta-sysmocom-bsp are already merged into laforge/nightly branch.

Actions #14

Updated by laforge over 5 years ago

OE related patches should all be merged now

Actions #15

Updated by pespin over 5 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Done, closing

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)