Zum Inhalt

Schlagwort: systemd

Unlock your /home partition and other volumes with cryptsetup on boot (Ubuntu 17.10 / systemd)

With Ubuntu 17.10 using systemd 234-2ubuntu12.1 (as of me writing this) you cannot just do it the obvious way:

This will create lines and/or keyfiles in /etc/crypttab, which systemd happily ignores. At least the unit-files systemd will generate on the fly will fail.

The way to do it, is adding the correct kernel boot parameters luks.uuid= and luks.options= lines to your grub config file.

For Ubuntu, i had to change /etc/default/grub from

GRUB_CMDLINE_LINUX=""

to

GRUB_CMDLINE_LINUX="luks.uuid=c142f353-fbe8-4965-931e-c9b1e9503fcd luks.uuid=91d55cef-d26c-4e42-8d97-c17a8df79c58 luks.options=timeout=90s"

Fun fact: if you leave out the timeout specification, systemd will simply not ask for the password, stating the timeout expired ^_^

After changing the file, run

sudo update-grub

Leave a Comment

MariaDB 10.1.28 with WSREP will not start – here's how you can fix it

If you are running MariaDB 10.1 branch on any major distro (Ububtu, CentOS/RHEL…) with WSREP=ON (indicating replication such as galera), then your MariaDB systemd unit will most likely fail to start.

Steps to reproduce:

  • Install mariadb-10.1.27 or earlier for any distro
  • enable WSREP (have a cluster running)
  • upgrade one node to 10.1.28
  • mysql will simply quit any time you start the systemd unit, with no fishy warning or error messages whatsowver, just a silent insta-death.

If you now try to run mysqld (do a "which mysqld") in foreground, it will actually keep on running.

Note: use "killall mysqld" on a different shell to gracefully quit mysqld when running in foreground, because mysqld will ignore you hammering Ctrl+C, duh.

So my guess was: "This has to do with the unit file, or with mysqld_safe". Turns out i was right, after a bit of googling i found this patch for mysqld_safe, which is just broken in that release.

diff mysqld_safe.bug mysqld_safe.fixed
249c249
< local wr_logfile=$(mktemp wsrep_recovery.XXXXXX)

> local wr_logfile=$(mktemp -t wsrep_recovery.XXXXXX)
271c271
< eval_log_error "$mysqld_cmd –wsrep_recover $wr_options 2> $wr_logfile"

> eval_log_error "$mysqld_cmd –wsrep_recover $wr_options > $wr_logfile"

Source: click here

I wonder how this can happen, do they run their rpm package tests only without replication enabled!?

Of course I hit this in production, where else!? You don't run replication in testing, because nobody is willing to pay the extra server(s) 😀

Leave a Comment