Dmx-headless – a package for non-desktop systems (public web-server)

Bildschirmfoto 2021-07-11 um 22.19.36

$ sudo apt list --upgradable -a
Listing… Done
dmx/xenial 5.2~1deb+b14288 all [upgradable from: 5.1-12323]
dmx/now 5.1-12323 all [installed,upgradable to: 5.2~1deb+b14288]

This host seems to be headless …
… meaning it has no graphical user insterface (Xorg or Xwayland) installed. Since DMX version 5.2 there are two different packages: 1. dmx - the default package for desktop systems (your private computer). 2. dmx-headless - a package for non-desktop systems (public web-server). It is highly recommended to uninstall the previously installed package (sudo apt remove dmx) and to install the dmx-headless package instead (sudo apt install dmx-headless).

Bildschirmfoto 2021-07-11 um 22.25.57

$ sudo apt remove dmx

$ sudo apt install dmx-headless
[…] Preconfiguring packages …
Selecting previously unselected package dmx-headless.
(Reading database … 124216 files and directories currently installed.)
Preparing to unpack …/dmx-headless_5.2~1deb+b14288_all.deb …
Running /var/lib/dpkg/tmp.ci/preinst install …
Running /var/lib/dpkg/tmp.ci/preinst install …

Progress: [ 20%] [#############################…]

Stays at 20% ?

$ sudo dpkg --configure -a

$ sudo apt autoremove

[…] Configuration file ‘/etc/dmx/config.properties’
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** config.properties (Y/I/N/O/D/Z) [default=N] ?
Progress: [ 97%] [############################################################################################################################################…]

Y
Installing new version of config file /etc/dmx/config.properties …
Running /var/lib/dpkg/info/dmx-headless.postinst configure …
Running /var/lib/dpkg/info/dmx-headless.postinst configure …
dmx.service is a disabled or a static unit not running, not starting it.
Processing triggers for hicolor-icon-theme (0.17-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for mime-support (3.62) …
Scanning processes…
Scanning linux images…

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

$ sudo apt install dmx-headless
Reading package lists… Done
Building dependency tree
Reading state information… Done
dmx-headless is already the newest version (5.2~1deb+b14288).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Configuration file ‘/etc/dmx/config.properties’

Will on occasion check the differences between the versions.

File Repository

[…]

Encoding

file.encoding = UTF-8

Hi @RalfBarkow , so what is the outcome of your upgrade, did it work or not? Yes, we now have separate packages for server and desktop installations of DMX. We upgraded our own instances with ‘apt remove dmx’ and ‘apt install dmx-headless’ without issues. We kept the old configuration file und everything ran just as before.

Thanks @sme Upgrade on my test system

$ sudo apt remove dmx
$ sudo apt install dmx-headless

got stuck, and I had to

$ sudo dpkg --configure -a
$ sudo apt autoremove

Now I want to review the updated version of the configuration file ‘/etc/dmx/config.properties’ before I continue. (“Package distributor has shipped an updated version.”)

Hoi @sme, production server is now running v5.2 (kept the old config).

But systemd service ends up in “inactive (dead)” after boot.

[Unit] After=?

After=graphical.target

@sme I feel dmx.service → /lib/systemd/system/dmx.service needs to be fixed for dmx-headless use case.

I have changed the [Unit] After entry as follows, so that the headless dmx.service is started automatically after a reboot:

[Unit]
Description=DMX - The Context Machine
Documentation=https://docs.dmx.systems
Requires=network.target
After=multi-user.target

Just reading Why do most systemd examples contain WantedBy=multi-user.target?

graphical.target is another possible alias for default.target. Normally it’s defined as a superset of the multi-user.target: it includes everything the multi-user.target does, plus the activation of a local GUI login. So kind of like runlevel 5 in classic SysVinit.

2 Likes

@RalfBarkow Thank you very much for reporting this issue! There was a bug in the build process which was fixed in the latest commit. Could you please run an upgrade on dmx-headless an check if it works for you now. Thank you!

1 Like

Yes Juergen @jpn, I will do an upgrade to version: 5.2~1deb+b14309 on occasion.

[…]
Preparing to unpack .../5-dmx-headless_5.2~1deb+b14339_all.deb ...
Running /var/lib/dpkg/info/dmx-headless.prerm upgrade ...
Running /var/lib/dpkg/info/dmx-headless.prerm upgrade ...
prerm called with unknown argument `upgrade'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Running /var/lib/dpkg/tmp.ci/prerm failed-upgrade 5.2~1deb+b14288 ...
Running /var/lib/dpkg/tmp.ci/prerm failed-upgrade 5.2~1deb+b14288 ...
dpkg: ... it looks like that went OK
Running /var/lib/dpkg/tmp.ci/preinst upgrade 5.2~1deb+b14288 ...
Running /var/lib/dpkg/tmp.ci/preinst upgrade 5.2~1deb+b14288 ...
Your existing database has been backed-up (copied) to /var/lib/dmx/dmx-db-5.2-backup-2021-07-21-21:27:49.
Unpacking dmx-headless (5.2~1deb+b14339) over (5.2~1deb+b14288) ...
Running /var/lib/dpkg/info/dmx-headless.postrm upgrade ...
Running /var/lib/dpkg/info/dmx-headless.postrm upgrade ...
[…]

it looks like that went OK

and

Status active (loaded) after reboot

@RalfBarkow Great! Thank you!

The problem remains that

$ sudo apt install dmx-headless 

sometimes gets stuck:

Preparing to unpack …/dmx-headless_5.2~1deb+b14339_all.deb …
Running /var/lib/dpkg/tmp.ci/preinst upgrade 5.2~1deb+b14288 …
Running /var/lib/dpkg/tmp.ci/preinst upgrade 5.2~1deb+b14288 …
Terminated
dpkg: error processing archive /var/cache/apt/archives/dmx-headless_5.2~1deb+b14339_all.deb (–unpack):
new dmx-headless package pre-installation script subprocess returned error exit status 143
Running /var/lib/dpkg/tmp.ci/postrm abort-upgrade 5.2~1deb+b14288 …
Running /var/lib/dpkg/tmp.ci/postrm abort-upgrade 5.2~1deb+b14288 …
Errors were encountered while processing:
/var/cache/apt/archives/dmx-headless_5.2~1deb+b14339_all.deb
Log ended: 2021-07-23 19:51:12

@RalfBarkow Since on that other machine you were also upgrading from the faulty version 5.2~1deb+b14288 I would assume this to be the reason causing the problem. We should keep an eye on that. I will soon publish a newer version of the package which will only include minor changes in the README files. I will inform you about the progress, so that you can than run another upgrade and see if the problem still remains. Thanks a lot for your feedback and effort!

@RalfBarkow I just built dmx-headless_5.2~1deb+b14373_all.deb so that you could run another test now with this latest version.

1 Like

Thanks Juergen! @jpn

Everything runs so far tip top. A small issue remains:

Your existing database has been backed-up (copied) to /var/lib/dmx/dmx-db-5.2-backup-2021-08-06-08:30:10.

Backup is probably always a good idea. In configurations like on my test system or a FreedomBox with separate partitions for data and binaries, the update script copies the backup of the dmx-db to the partition with the binaries and the hangs I described occur when this partition is full.

On my FreedomBox, I had to run sudo apt-mark hold dmx-headless.

Hi @RalfBarkow, could you please further explain your problem. I do not quite understand what is going on on your FreedomBox. Relating to Filesystem Hierarchy Standard - Wikipedia both the database and the backups of the database are stored in the /var/lib/dmx folder. Did you change the path of the database? If so, why? To my understanding both the database and the backup of the database are both data (not binaries). Or is it that your /var/lib/ volume does not have enough disk space for all the backups? Please share your file system structure and let me know, where the DMX files are stored on your FreedomBox. Would you prefer to store the backups in a different location (where?). Or would you want to disable the process of creating the backups in general? Thanks for your help!

@jpn Thanks Juergen. On that FreedomBox system, /var/lib/dmx/dmx-db is an NFS mount pointing to a NAS server. rootfs is on a MicroSD with 14,8 GiB. Now every dmx-headless update copies the dmx-db from the NAS server to the MicroSD card, and when there is no more space on the MicroSD card, the update hangs. I want the dmx-headlesss update script to prevent this situation.

Hi @RalfBarkow! Thank you, now I understand. From my point of view the ideal way to solve your issue would be to change the mount point of your NFS storage from /var/lib/dmx/dmx-db to just /var/lib/dmx. To my understanding that would solve the current problem well, but also allow you to stay aligned with the general filesystem hierarchy of DMX, including the default path for file uploads, which (for networked installations) is located in /var/lib/dmx/dmx-filedir by default. The /var/lib/dmx folder is meant to be the place for all your productive data. Both folders /var/lib/dmx-db and /var/lib/dmx-filedir and the regular database backups would then reside on your NAS. Would that work for you?

1 Like

@jpn Thanks Juergen, sounds good! Will try to change my configuration accordingly.

I have rebuilt this accordingly and now everything seems to run as desired. Thanks a lot @jpn.

1 Like