Post

ENG | Upgrading Fedora 42 to 44

ENG | Upgrading Fedora 42 to 44

This article is not so much about Fedora update, like stuff that can go wrong.

I never had so much issues, it was usually something with Jekyll. But last Fedora update was done year ago and I don’t recall problems with PostgreSQL or Python. Just jekyll usually needed 20 minutes to fix.

In the April I had some issues with podman and systemd which I need to eventually resolve, unless they resolved themselves. These were related to either something with containers (I suppose Umami) or some KDE core dumps crashing in recursion, between no graphic server is running.

I also had recently issues with upgrading Forgejo (and MariaDB) and podman - here it was also something with internal database with warning it will be discontinued in the summer and this update was basically removing all containers and volumes, pulling containers again and restoring volumes from backup. But before, server needed minimum maintenance.

Fedora update

This step is easy. It just takes 20-25 minutes. Guide is here

  1. sudo dnf upgrade --refresh
  2. sudo reboot
  3. sudo dnf system-upgrade download --releasever=44 - this takes few minutes and may fail on some conflicts such as tuned-ppd and tlp
  4. sudo dnf offline reboot - this takes roughly 20 to 25 minutes on my i5-6500T with cca 3300 packages

Jekyll/Chirpy, Ruby gems, npm

My script ended by several errors

1
~/bin/podman-jekyll-update.sh
1
2
3
4
5
6
7
8
9
/usr/share/gems/gems/bundler-4.0.3/lib/bundler/definition.rb:702:in 'Bundler::Definition#materialize': Could not find io-event-1.14.2, racc-1.8.1, json-2.18.0, bigdecimal-3.3.1 in locally installed gems (Bundler::GemNotFound)
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/definition.rb:240:in 'Bundler::Definition#specs'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/definition.rb:312:in 'Bundler::Definition#specs_for'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/runtime.rb:18:in 'Bundler::Runtime#setup'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler.rb:165:in 'Bundler.setup'
	from /usr/share/gems/gems/jekyll-4.4.1/lib/jekyll/plugin_manager.rb:52:in 'Jekyll::PluginManager.require_from_bundler'
	from /usr/share/gems/gems/jekyll-4.4.1/exe/jekyll:11:in '<top (required)>'
	from /usr/bin/jekyll:25:in 'Kernel#load'
	from /usr/bin/jekyll:25:in '<main>'

I tried deleting ~/gems directory, running commands such as this that always failed by version solving failed message.

1
2
3
4
5
6
7
8
9
10
11
12
13
[pavel@marten -=- ~/dev-blog]$ bundler update
Ignoring bigdecimal-3.3.1 because its extensions are not built. Try: gem pristine bigdecimal --version 3.3.1
...
Ignoring racc-1.8.1 because its extensions are not built. Try: gem pristine racc --version 1.8.1
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Could not find compatible versions

Because every version of jekyll-theme-chirpy depends on Ruby ~> 3.1
  and Gemfile depends on jekyll-theme-chirpy >= 0,
  Ruby ~> 3.1 is required.
So, because current Ruby version is = 4.0.1,
  version solving has failed.

Wait … I have Ruby 4.0.1, Jekyll requires greater than 3.1 or … not. Actually ~> 3.1 means that last number could be greater than 1. At this point I updated Jekyll expecting that problem will be resolved by a new version.

Upgrading Jekyll-chirpy (git merge)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[pavel@marten -=- ~/dev-blog]$ git remote -v
github	https://github.com/cotes2020/jekyll-theme-chirpy.git (fetch)
github	https://github.com/cotes2020/jekyll-theme-chirpy.git (push)
origin	https://git.pavelp.cz/pavel.perina/blog.git (fetch)
origin	https://git.pavelp.cz/pavel.perina/blog.git (push)
[pavel@marten -=- ~/dev-blog]$ git fetch github
remote: Enumerating objects: 236, done.
remote: Counting objects: 100% (76/76), done.
remote: Total 236 (delta 76), reused 76 (delta 76), pack-reused 160 (from 1)
Receiving objects: 100% (236/236), 250.61 KiB | 2.98 MiB/s, done.
Resolving deltas: 100% (119/119), completed with 52 local objects.
From https://github.com/cotes2020/jekyll-theme-chirpy
 * [new branch]      dependabot/github_actions/dot-github/workflows/gh-actions-67349225b1 -> github/dependabot/github_actions/dot-github/workflows/gh-actions-67349225b1
 * [new branch]      dependabot/npm_and_yarn/dev-deps-b6ff01f021                          -> github/dependabot/npm_and_yarn/dev-deps-b6ff01f021
   eaf5e57..2685b91  master                                                               -> github/master
   c0e4756..297fbde  production                                                           -> github/production
 * [new tag]         v7.5.0                                                               -> v7.5.0
 * [new tag]         v7.4.0                                                               -> v7.4.0
 * [new tag]         v7.4.1                                                               -> v7.4.1
Fetching submodule assets/lib
From https://github.com/cotes2020/chirpy-static-assets
   02f4ada..8ad46c0  main       -> origin/main
[pavel@marten -=- ~/dev-blog]$ git fetch github --tags
[pavel@marten -=- ~/dev-blog]$ git merge v7.5.0
Auto-merging _config.yml
CONFLICT (content): Merge conflict in _config.yml
CONFLICT (modify/delete): _posts/2019-08-08-text-and-typography.md deleted in HEAD and modified in v7.5.0.  Version v7.5.0 of _posts/2019-08-08-text-and-typography.md left in tree.
CONFLICT (modify/delete): _posts/2019-08-08-write-a-new-post.md deleted in HEAD and modified in v7.5.0.  Version v7.5.0 of _posts/2019-08-08-write-a-new-post.md left in tree.
CONFLICT (modify/delete): _posts/2019-08-09-getting-started.md deleted in HEAD and modified in v7.5.0.  Version v7.5.0 of _posts/2019-08-09-getting-started.md left in tree.
CONFLICT (modify/delete): _posts/2019-08-11-customize-the-favicon.md deleted in HEAD and modified in v7.5.0.  Version v7.5.0 of _posts/2019-08-11-customize-the-favicon.md left in tree.
Auto-merging assets/css/jekyll-theme-chirpy.scss
Automatic merge failed; fix conflicts and then commit the result.
[pavel@marten -=- ~/dev-blog]$ git rm _posts/2019-08-08-text-and-typography.md _posts/2019-08-08-write-a-new-post.md _posts/2019-08-09-getting-started.md _posts/2019-08-11-customize-the-favicon.md
rm '_posts/2019-08-08-text-and-typography.md'
rm '_posts/2019-08-08-write-a-new-post.md'
rm '_posts/2019-08-09-getting-started.md'
rm '_posts/2019-08-11-customize-the-favicon.md'
[pavel@marten -=- ~/dev-blog]$ nvim _config.yml
[pavel@marten -=- ~/dev-blog]$ git add _config.yml
[pavel@marten -=- ~/dev-blog]$ git status
On branch pavel
Your branch is up to date with 'origin/pavel'.

All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Changes to be committed:
...
1
2
3
4
5
6
[pavel@marten -=- ~/dev-blog]$ git commit
[pavel 6bd3db2] Merge tag 'v7.5.0' into pavel
[pavel@marten -=- ~/dev-blog]$ git status
On branch pavel
Your branch is ahead of 'origin/pavel' by 100 commits.
  (use "git push" to publish your local commits)

In the end, I edited version in gemspec file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[pavel@marten -=- ~/dev-blog]$ cat jekyll-theme-chirpy.gemspec
# frozen_string_literal: true

Gem::Specification.new do |spec|
  spec.name          = "jekyll-theme-chirpy"
  spec.version       = "7.5.0"
  spec.authors       = ["Cotes Chung"]
  spec.email         = ["[email protected]"]

  spec.summary       = "A minimal, responsive, and feature-rich Jekyll theme for technical writing."
  spec.homepage      = "https://github.com/cotes2020/jekyll-theme-chirpy"
  spec.license       = "MIT"

  spec.files         = `git ls-files -z`.split("\x0").select { |f|
    f.match(%r!^((_(includes|layouts|sass|(data\/(locales|origin)))|assets)\/|README|LICENSE)!i)
  }

  spec.metadata = {
    "bug_tracker_uri"   => "https://github.com/cotes2020/jekyll-theme-chirpy/issues",
    "documentation_uri" => "https://github.com/cotes2020/jekyll-theme-chirpy/#readme",
    "homepage_uri"      => "https://cotes2020.github.io/chirpy-demo",
    "source_code_uri"   => "https://github.com/cotes2020/jekyll-theme-chirpy",
    "wiki_uri"          => "https://github.com/cotes2020/jekyll-theme-chirpy/wiki",
    "plugin_type"       => "theme"
  }

  spec.required_ruby_version = "~> 3.1"

  spec.add_runtime_dependency "jekyll", "~> 4.3"
  spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
  spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.8"
  spec.add_runtime_dependency "jekyll-archives", "~> 2.2"
  spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4"
  spec.add_runtime_dependency "jekyll-include-cache", "~> 0.2"

end

[pavel@marten -=- ~/dev-blog]$ ruby --version
ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [x86_64-linux]

[pavel@marten -=- ~/dev-blog]$ nvim jekyll-theme-chirpy.gemspec

[pavel@marten -=- ~/dev-blog]$ git diff jekyll-theme-chirpy.gemspec 
diff --git a/jekyll-theme-chirpy.gemspec b/jekyll-theme-chirpy.gemspec
index 76e7369..33e86d9 100644
--- a/jekyll-theme-chirpy.gemspec
+++ b/jekyll-theme-chirpy.gemspec
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
     "plugin_type"       => "theme"
   }
 
-  spec.required_ruby_version = "~> 3.1"
+  spec.required_ruby_version = ">= 3.1"
 
   spec.add_runtime_dependency "jekyll", "~> 4.3"
   spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"

[pavel@marten -=- ~/dev-blog]$ bundle
In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
or you can continue to use the current behavior with `bundle config set default_cli_command install --global`.
This message will be removed after a default_cli_command value is set.

Fetching gem metadata from https://rubygems.org/..........
Local specification for listen-3.7.1 has different dependencies than the remote gem, ignoring it
Local specification for em-websocket-0.5.3 has different dependencies than the remote gem, ignoring it
Resolving dependencies...
Fetching rake 13.4.2
Installing rake 13.4.2
...
Bundle complete! 5 Gemfile dependencies, 64 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details

[pavel@marten -=- ~/dev-blog]$ podman-jekyll-update.sh
👷 Rebuilding static web content ...
/usr/share/gems/gems/bundler-4.0.3/lib/bundler/runtime.rb:321:in 'Bundler::Runtime#check_for_activated_spec!': You have already activated bigdecimal 4.0.1, but your Gemfile requires bigdecimal 3.3.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/runtime.rb:25:in 'block in Bundler::Runtime#setup'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/spec_set.rb:224:in 'Array#each'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/spec_set.rb:224:in 'Bundler::SpecSet#each'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/runtime.rb:24:in 'Enumerable#map'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler/runtime.rb:24:in 'Bundler::Runtime#setup'
	from /usr/share/gems/gems/bundler-4.0.3/lib/bundler.rb:165:in 'Bundler.setup'
	from /usr/share/gems/gems/jekyll-4.4.1/lib/jekyll/plugin_manager.rb:52:in 'Jekyll::PluginManager.require_from_bundler'
	from /usr/share/gems/gems/jekyll-4.4.1/exe/jekyll:11:in '<top (required)>'
	from /usr/bin/jekyll:25:in 'Kernel#load'
	from /usr/bin/jekyll:25:in '<main>'

Ufff …. this actually required to modify my script and adding bundle exec:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/dash
# Updates jekyll site in container

target="nginx:/config/www"

# Old blog based on minima theme, used before 2023-06-24
#podman cp ~/jekyll/blog/_site/. $target

# New blog based on chirpy theme, used since 2023-06-24
source="/home/pavel/dev-blog"
cd $source
echo "👷 Rebuilding static web content ..."
JEKYLL_ENV=production bundle exec jekyll build || exit
echo "🔥 Deleting old content, don't panic! ..."
podman exec nginx sh -c "cd /config/www && rm -rf *"
echo "🚚 Copying new content ..."

podman cp _site/. $target
# The following lines added 2024-03-18
podman cp ~/jekyll/googleb917xxxxxxxxxx.html nginx:/config/www
podman cp ~/jekyll/BingSiteAuth.xml nginx:/config/www

Now we also need this for Table of Content working:

1
2
3
4
cd ~/dev-blog
npm install
npm audit fix
npm run build

But it also needs to delete Cloudflare cache and reload page in browser. It took maybe half hour and problem fixed itself.

Few things does not yet run manually

Weather station server

Setup is documented in _posts/2025-01-07-eng-plotting-sensor-data.md

TODO: fix link

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ setopt nohup
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ nohup python server.py >> nohup.out 2>&1 &
[1] 31326
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ 
[1]  + exit 1     nohup python server.py >> nohup.out 2>&1
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ 
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ tail nohup.out
192.168.68.13 - - [05/May/2026 17:39:58] "POST /upload HTTP/1.0" 200 -
{'station_id': 'sta01', 'time': '2026-05-05T15:44:55Z', 'temperature': 24.44, 'pressure': 97675.8, 'humidity': 35.12, 'time_of_arrival': '2026-05-05T15:45:00Z'}
known station
2026-05-05 17:45:00,124 INFO    : Received and logged data: {'station_id': 'sta01', 'time': '2026-05-05T15:44:55Z', 'temperature': 24.44, 'pressure': 97675.8, 'humidity': 35.12, 'time_of_arrival': '2026-05-05T15:45:00Z', 'dew_point': 8.044384614593843, 'sea_level_pressure': 100623.1817672218, 'specific_humidity': 0.006880332997177664}
192.168.68.13 - - [05/May/2026 17:45:00] "POST /upload HTTP/1.0" 200 -
nohup: ignoring input
Traceback (most recent call last):
  File "/home/pavel/dev-py/pico_weather_station/server/server.py", line 3, in <module>
    from flask import Flask
ModuleNotFoundError: No module named 'flask'

Aha … I upgraded from Fedora 42 released in mid April 2025 to Fedora 44 released in late April 2026. New Python was released in October.

Python upgrade

This installs Pillow, Numpy, Matplotlib as dependencies. Weird deps are PostgresSQL for Python

1
2
grep import *.py
pip install flask seaborn opencv-python sqlalchemy psycopg2-binary

PostgreSQL upgrade

Fun does not end here. Later I discovered that new data are not in the database and displayed on page. Little inspection

1
2
3
4
5
6
7
[pavel@marten -=- ~/dev-py/pico-weather-station/server] tail nohup.out
Background on this error at: https://sqlalche.me/e/20/e3q8)
192.168.68.13 - - [05/May/2026 23:17:13] "POST /upload HTTP/1.0" 500 -
{'station_id': 'sta01', 'time': '2026-05-05T21:22:07Z', 'temperature': 22.32, 'pressure': 97752.7, 'humidity': 40.44, 'time_of_arrival': '2026-05-05T21:22:12Z'}
known station
2026-05-05 23:22:12,611 ERROR   : Error processing data: (psycopg2.OperationalError) connection to server on socket "/home/pavel/postgre-sockets/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?

Hmm, server not running?

1
2
3
4
5
6
7
[pavel@marten -=- ~]$ pg_ctl -D /home/pavel/postgre-data -l logfile start
waiting for server to start....pg_ctl: control file appears to be corrupt

[pavel@marten -=- ~]$ cat logfile 
2026-05-05 23:40:25.929 CEST [64601] FATAL:  database files are incompatible with server
2026-05-05 23:40:25.929 CEST [64601] DETAIL:  The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 18.3.
[pavel@marten -=- ~]$ 

Wait, what?

Database migration

Here, basically easiest way is to restore backup. Other option is likely using old postgreSQL in container to access old database. Good start is to stop the service, backup data. Then it was recommended to install old server, which obviously does not work. Next attempt was to create new data directory and start postresql. Which silently failed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[pavel@marten -=- ~]$ systemctl --user stop postgresql.service

[pavel@marten -=- ~]$ cp -a postgre-data postgre-data-backup-pg16

[pavel@marten -=- ~]$ sudo dnf in postgresql16-server
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Problem: problem with installed package
  - installed package postgresql-server-18.3-1.fc44.x86_64 conflicts with postgresql-server-any provided by postgresql16-server-16.13-1.fc44.i686 from fedora
  - package postgresql-server-18.3-1.fc44.x86_64 from fedora conflicts with postgresql-server-any provided by postgresql16-server-16.13-1.fc44.i686 from fedora
  - conflicting requests
  - installed package postgresql-server-18.3-1.fc44.x86_64 conflicts with postgresql-server-any provided by postgresql16-server-16.13-1.fc44.x86_64 from fedora
  - package postgresql-server-18.3-1.fc44.x86_64 from fedora conflicts with postgresql-server-any provided by postgresql16-server-16.13-1.fc44.x86_64 from fedora
You can try to add to command line:
  --allowerasing to allow removing of installed packages to resolve problems
  --skip-broken to skip uninstallable packages

[pavel@marten -=- ~]$ initdb -D postgre-data-pg18
The files belonging to this database system will be owned by user "pavel".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are enabled.

creating directory postgre-data-pg18 ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Europe/Prague
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D postgre-data-pg18 -l logfile start

[pavel@marten -=- ~]$ postgres -D ~/postgre-data-pg18
2026-05-06 17:35:49.781 CEST [461413] LOG:  redirecting log output to logging collector process
2026-05-06 17:35:49.781 CEST [461413] HINT:  Future log output will appear in directory "log".

[pavel@marten -=- ~]$ cat ~/postgre-data-pg18/log/postgresql-Wed.log
2026-05-06 17:35:49.781 CEST [461413] LOG:  starting PostgreSQL 18.3 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 16.0.1 20260305 (Red Hat 16.0.1-0), 64-bit
2026-05-06 17:35:49.782 CEST [461413] LOG:  listening on IPv6 address "::1", port 5432
2026-05-06 17:35:49.782 CEST [461413] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2026-05-06 17:35:49.784 CEST [461413] FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
2026-05-06 17:35:49.786 CEST [461413] LOG:  database system is shut down

Aha. Back to install notes from year and half ago. We do not need to create directory

1
FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied

Fix it by editing ~/postgre-data/postgresql.conf, you can add something like unix_socket_directories = '/home/pavel/postgre-sockets' and create directory by

1
mkdir ~/postgre-sockets

Start service again and verify it runs

1
2
systemctl --user start postgresql
systemctl --user status postgresql

Now something (not) new:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ systemctl --user status postgresql
× postgresql.service - PostgreSQL database server
     Loaded: loaded (/home/pavel/.config/systemd/user/postgresql.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Wed 2026-05-06 20:00:15 CEST; 4s ago
   Duration: 24ms
 Invocation: 642510086dd8447f877ce3e2d63d4137
    Process: 526519 ExecStart=/usr/bin/postgres -D /home/pavel/postgre-data (code=exited, status=1/FAILURE)
   Main PID: 526519 (code=exited, status=1/FAILURE)
   Mem peak: 2.6M
        CPU: 18ms

May 06 20:00:15 marten systemd[1455]: postgresql.service: Scheduled restart job, restart counter is at 5.
May 06 20:00:15 marten systemd[1455]: postgresql.service: Start request repeated too quickly.
May 06 20:00:15 marten systemd[1455]: postgresql.service: Failed with result 'exit-code'.
May 06 20:00:15 marten systemd[1455]: Failed to start postgresql.service - PostgreSQL database server.

Ha, it points to old data. This needs modification of ~/.config/systemd/user/postgresql.service

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=PostgreSQL database server
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/pavel/postgre-data-pg18
ExecStart=/usr/bin/postgres -D /home/pavel/postgre-data-pg18
ExecStop=/usr/bin/pg_ctl -D /home/pavel/postgre-data-pg18 stop
Restart=always

[Install]
WantedBy=default.target
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[pavel@marten -=- ~]$ systemctl --user start postgresql
Warning: The unit file, source configuration file or drop-ins of postgresql.service changed on disk. Run 'systemctl --user daemon-reload' to reload units.
[pavel@marten -=- ~]$ systemctl --user daemon-reload
[pavel@marten -=- ~]$ systemctl --user start postgresql
[pavel@marten -=- ~]$ systemctl --user status postgresql
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/home/pavel/.config/systemd/user/postgresql.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Wed 2026-05-06 20:08:19 CEST; 4s ago
 Invocation: c70c98774c6a4484bef1347428520bcb
   Main PID: 531330 (postgres)
      Tasks: 10 (limit: 38164)
     Memory: 21.9M (peak: 22.5M)
        CPU: 47ms
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/postgresql.service
             ├─531330 /usr/bin/postgres -D /home/pavel/postgre-data-pg18
             ├─531331 "postgres: logger "
             ├─531332 "postgres: io worker 0"
             ├─531333 "postgres: io worker 1"
             ├─531334 "postgres: io worker 2"
             ├─531335 "postgres: checkpointer "
             ├─531336 "postgres: background writer "
             ├─531338 "postgres: walwriter "
             ├─531339 "postgres: autovacuum launcher "
             └─531340 "postgres: logical replication launcher "

May 06 20:08:19 marten systemd[1455]: Started postgresql.service - PostgreSQL database server.
May 06 20:08:19 marten postgres[531330]: 2026-05-06 20:08:19.383 CEST [531330] LOG:  redirecting log output to logging collector process
May 06 20:08:19 marten postgres[531330]: 2026-05-06 20:08:19.383 CEST [531330] HINT:  Future log output will appear in directory "log".

[pavel@marten -=- ~]$ pg_ctl -D ~/postgre-data-pg18 status
pg_ctl: server is running (PID: 531330)
/usr/bin/postgres "-D" "/home/pavel/postgre-data-pg18"

[pavel@marten -=- ~]$ zstd -d ~/backup/weather_data-2026-05-05.sql.zstd -c | psql -h ~/postgre-sockets -d weather_data
psql: error: connection to server on socket "/home/pavel/postgre-sockets/.s.PGSQL.5432" failed: FATAL:  database "weather_data" does not exist

[pavel@marten -=- ~]$ psql -h ~/postgre-sockets -d postgres
psql (18.3)
Type "help" for help.

postgres=# create database weather_data;
CREATE DATABASE
postgres=# \q

[pavel@marten -=- ~]$ zstd -d ~/backup/weather_data-2026-05-05.sql.zstd -c | psql -h ~/postgre-sockets -d weather_data
SET
SET
SET
SET
SET
 set_config
------------

(1 row)

SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
CREATE VIEW
ALTER VIEW
CREATE MATERIALIZED VIEW
ALTER MATERIALIZED VIEW
CREATE VIEW
ALTER VIEW
CREATE VIEW
ALTER VIEW
CREATE TABLE
ALTER TABLE
CREATE VIEW
ALTER VIEW
COPY 7303
COPY 214876
ALTER TABLE
REFRESH MATERIALIZED VIEW

[pavel@marten -=- ~]$ psql -h ~/postgre-sockets -d weather_data
psql (18.3)
Type "help" for help.

weather_data=# \dt
              List of tables
 Schema |      Name       | Type  | Owner
--------+-----------------+-------+-------
 public | staging_weather | table | pavel
 public | weather_data    | table | pavel
(2 rows)

weather_data=# \d weather_data
                            Table "public.weather_data"
        Column         |           Type           | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
 station_id            | text                     |           | not null |
 timestamp             | timestamp with time zone |           | not null |
 temperature           | real                     |           |          |
 humidity              | real                     |           |          |
 pressure_at_station   | real                     |           |          |
 dew_point             | real                     |           |          |
 pressure_at_sea_level | real                     |           |          |
 specific_humidity     | real                     |           |          |
Indexes:
    "weather_data_pkey" PRIMARY KEY, btree (station_id, "timestamp")

weather_data=# select count(*) from weather_data;
 count
--------
 214876
(1 row)

weather_data=# select * from weather_data order by timestamp desc limit 1;
 station_id |       timestamp        | temperature | humidity | pressure_at_station | dew_point | pressure_at_sea_level | specific_humidity
------------+------------------------+-------------+----------+---------------------+-----------+-----------------------+-------------------
 sta01      | 2026-05-04 23:59:50+02 |        21.9 |    38.03 |               98355 |  6.963204 |            101322.875 |       0.006344111
(1 row)

weather_data=# \q

[pavel@marten -=- ~]$ cd dev-py/pico_weather_station/server

[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ setopt nohup

[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ nohup python server.py >> nohup.out 2>&1 &
[1] 540951

[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ tail nohup.out
2026-05-06 20:30:36,304 INFO    : Received and logged data: {'station_id': 'sta01', 'time': '2026-05-06T18:22:14Z', 'temperature': 23.15, 'pressure': 97610.2, 'humidity': 41.99, 'time_of_arrival': '2026-05-06T18:30:36Z', 'dew_point': 9.539510191940549, 'sea_level_pressure': 100555.60227748197, 'specific_humidity': 0.007620921314042863}
192.168.68.13 - - [06/May/2026 20:30:36] "POST /upload HTTP/1.0" 200 -
{'station_id': 'sta01', 'time': '2026-05-06T18:27:16Z', 'temperature': 23.28, 'pressure': 97627.9, 'humidity': 41.86, 'time_of_arrival': '2026-05-06T18:30:36Z'}
known station
2026-05-06 20:30:36,327 INFO    : Received and logged data: {'station_id': 'sta01', 'time': '2026-05-06T18:27:16Z', 'temperature': 23.28, 'pressure': 97627.9, 'humidity': 41.86, 'time_of_arrival': '2026-05-06T18:30:36Z', 'dew_point': 9.609714717681346, 'sea_level_pressure': 100573.83637760994, 'specific_humidity': 0.0076561144319906415}
192.168.68.13 - - [06/May/2026 20:30:36] "POST /upload HTTP/1.0" 200 -
{'station_id': 'sta01', 'time': '2026-05-06T18:32:16Z', 'temperature': 23.41, 'pressure': 97622.4, 'humidity': 41.66, 'time_of_arrival': '2026-05-06T18:32:19Z'}
known station
2026-05-06 20:32:19,610 INFO    : Received and logged data: {'station_id': 'sta01', 'time': '2026-05-06T18:32:16Z', 'temperature': 23.41, 'pressure': 97622.4, 'humidity': 41.66, 'time_of_arrival': '2026-05-06T18:32:19Z', 'dew_point': 9.654322914649557, 'sea_level_pressure': 100568.17041429334, 'specific_humidity': 0.007679793760984666}
192.168.68.13 - - [06/May/2026 20:32:19] "POST /upload HTTP/1.0" 200 -

[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ psql -h ~/postgre-sockets -d weather_data
psql (18.3)
Type "help" for help.

weather_data=# select * from weather_data order by timestamp desc limit 5;
 station_id |       timestamp        | temperature | humidity | pressure_at_station | dew_point | pressure_at_sea_level | specific_humidity
------------+------------------------+-------------+----------+---------------------+-----------+-----------------------+-------------------
 sta01      | 2026-05-06 20:32:16+02 |       23.41 |    41.66 |             97622.4 |  9.654323 |             100568.17 |       0.007679794
 sta01      | 2026-05-06 20:27:16+02 |       23.28 |    41.86 |             97627.9 | 9.6097145 |            100573.836 |      0.0076561146
 sta01      | 2026-05-06 20:22:14+02 |       23.15 |    41.99 |             97610.2 |   9.53951 |              100555.6 |      0.0076209214
 sta01      | 2026-05-04 23:59:50+02 |        21.9 |    38.03 |               98355 |  6.963204 |            101322.875 |       0.006344111
 sta01      | 2026-05-04 23:54:50+02 |       21.95 |    38.03 |             98365.3 |  7.007648 |            101333.484 |        0.00636272
(5 rows)

weather_data=# \q

[pavel@marten -=- ~/dev-py/pico_weather_station/server]$ date
Wed May  6 08:33:34 PM CEST 2026
This post is licensed under CC BY 4.0 by the author.