Project

General

Profile

Bug #2602

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

Added by laforge 11 months ago. Updated 8 days ago.

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

100%

Estimated time:
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 GuideNew2017-11-07

History

#1 Updated by lynxis 10 months 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.

#2 Updated by lynxis 10 months ago

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

#3 Updated by lynxis 10 months ago

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

#4 Updated by laforge about 2 months 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.

#5 Updated by pespin 21 days 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

#6 Updated by pespin 19 days 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.

#7 Updated by pespin 19 days 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

#8 Updated by pespin 13 days 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.

#9 Updated by pespin 13 days 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.

#10 Updated by pespin 13 days 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.

#11 Updated by pespin 12 days ago

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

All patches are submitted now in gerrit.

#12 Updated by pespin 12 days ago

Missing once merged: Update OE recipes.

#13 Updated by pespin 11 days 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.

#14 Updated by laforge 10 days ago

OE related patches should all be merged now

#15 Updated by pespin 8 days ago

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

Done, closing

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)