Temp Files in RHEL7

I had an RHEL7 system that would not start mariadb server on boot. I could reinstall the server rpm and then it would work fine, but it would not start after a reboot. So I finally had some time to figure out what’s going on.

First of all, here’s the part of the journalctl -xe command that’s relevant:

[~]# journalctl -xe
-- Unit mariadb.service has begun starting up.
Oct 25 09:30:33 host systemd[14587]: Failed at step GROUP spawning /usr/libexec/mariadb-prepare-db-dir: No such process
-- Subject: Process /usr/libexec/mariadb-prepare-db-dir could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

The problem was always this line:

Failed at step GROUP spawning /usr/libexec/mariadb-prepare-db-dir: No such process

That file is a script that is always there. So I tried to run just that script and got this:

[~]# /usr/libexec/mariadb-prepare-db-dir 
chown: invalid group: ‘mysql:mysql’

My first problem was that my group mysql somehow disappeared. So I readded that and tried to start mariadb again. Looking at just the problem area:

-- Unit mariadb.service has begun starting up.
Oct 25 09:32:32 host mysqld_safe[14744]: 161025 09:32:32 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Oct 25 09:32:32 host mysqld_safe[14744]: 161025 09:32:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Oct 25 09:32:34 host mysqld_safe[14744]: 161025 09:32:34 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
Oct 25 09:32:34 host systemd[1]: mariadb.service: control process exited, code=exited status=1
Oct 25 09:32:34 host systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed

And now I immediately see the problem. It’s trying to get the pid file from /var/run/mariadb. However, as of RHEL7, /var/run is a TEMPFILE that gets recreated with each boot. So if you make a directory in /var/run (which installing the mariadb-server rpm probably does), that directory will be deleted on a reboot. In order to make that directory each time the system is booted, I need to create a file.

In /etc/tmpfiles.d, create mariadb.conf with the following contents:

[/etc/tmpfiles.d] $ cat mariadb.conf 
# mariadb needs a directory in /var/run to store its pid file and args file
d /var/run/mariadb 0755 mysql mysql

Now reboot. And mariadb server starts up as it should.

On a related note, I had the same issue on a different server with openldap. There, I needed to add to /etc/tmpfiles.d, an openldap.conf file.

[/etc/tmpfiles.d]# more openldap.conf 
# slapd needs a directory in /var/run to store its pid file and args file
d /var/run/openldap 0755 ldap ldap

Birthday Project Result

I took my book out of the press this morning. It’s not perfect, but it’s not at all bad for my first attempt.

The cover looks good.

This is my first mistake. I glued the cover paper too much to the text block. I think I maybe did 1/4″ of glue. It should have been much less.

Here you can see a bit better that I glued too high on the cover.

And I made the same mistake on the back cover.

The back looks good. But the cover overhangs the pages of the book too much. I think instead of adding and extra inch of leather for the cover, I should have just added and extra 1/2″ to fold over.

But, by and large, I’m happy with the result. And now, I’m going to start using it as my own cookbook.

Birthday Project Part 2

My post yesterday wasn’t accurate. I hadn’t yet finished my text block. I still had to put the cover pages on it and the reinforcing paper. Before that though, I had to glue the binding. I made a book press out of a couple of pieces of wood and some clamps.


I put two coats of glue on the binding. Then I pressed the book. I just put it back between the wood and put some weights on it. In the picture below, this is not nearly enough weight. The pages were a little wrinkly.


Next, I glued my orange cover pieces on. This is a little heavier paper.


After that, another piece of paper is added for extra support.


At this point, my text block was done. Now I just had to figure out how to make a cover. I didn’t really want this to have a thick, hard cover, but something thinner. Then I remembered that I bought a piece of leather to play around with, so why not use that. I traced the book outline, then added 1/2 inch extra for the cover to go beyond the paper and then another 1″ to fold over. And I cut it out.


This is the point where I actually realized that my weights on wood wasn’t going to work. So I ran to Ace Hardware and bought some bolts, washers and wingnuts and built a sort of press. I then put the text block in there to try to flatten all the pages.



Back to the cover. I was supposed to trim the corners sort of like below for folding. I’m not exactly sure how they were supposed to be cut, but I was close. (Though in the end not close enough.)


Next I had to glue the parts of the cover to fold over. In the video, the person used hot glue. I don’t have a hot glue gun, so I just used the pva glue I had been using. In the photo below, I can tell you that I used WAY too much glue. It made a big mess.


Since the leather was sort of thick, I tried putting my weights on the edge to hold it down.


That really didn’t work, so I got a board and some clamps and used them. This worked much better.


On the last edge, I finally figured out how much glue I should be putting down. Below shows how much I squeezed out of the jar and then how it looked after I smoothed it with my finger.



And here is my final cover. Note that the corners are not near square, which fits with my inability to make anything square. But it’s not horrible for my first attempt ever.


Now, because I’m just like Cowboy X from Sesame Street, I had to use my brand.



Based on the horrible smell that the brand made on the leather, I never want to be on a farm when they are branding cows.

Now the last step is to glue the text block to the cover. Here I’m laying it out to make sure I know where to put glue and where to put down the text block.



I didn’t take a picture of it with the glue on it, but here’s how it looked before putting it in the press.


And here it is, drying in the press. I added a couple more clamps to try to make it as smooth as possible.


I’ll leave it to dry overnight and see how it all turns out tomorrow. Fingers crossed that it’s not too horrible.

Along with the YouTube video I posted yesterday for how to create the text block, I also referenced these videos.

Birthday Project

I’m on my annual birthday vacation. Just took three days this year instead of the whole week. And instead of taking a class somewhere, I decided to try to teach myself how to bind a book. Technically, I should say I’m learning how to do this from YouTube videos. First up, I folded and cut a bunch of paper. Then I had to sew them into a text block. I followed the video below:

The instructions were great and below is my text block.


It’s not perfect, but I think it’s pretty good for a first attempt. I also know that if I do this again, I need to get an awl with a really sharp point. Or put a handle on a needle to poke the holes through the paper.

Next, I need to glue it up and then figure out how to put a cover on. But that’s another video to watch.