[systemd-devel] RFC: idea for a pstore systemd service

Jóhann B. Guðmundsson johannbg at gmail.com
Tue Jan 15 23:39:35 UTC 2019


On 1/15/19 6:49 PM, Lennart Poettering wrote:
> On Di, 15.01.19 11:23, Eric DeVolder (eric.devolder at oracle.com) wrote:
>
>> Systemd-devel,
>>
>> Below is a write-up I've done to explain a new service for archiving pstore
>> contents. I've attached the pstore.service files
>> (/lib/systemd/system/pstore.service and bin/pstore-tool). These are trivial
>> right now, but easy to build upon if periodic, rather than just on-boot,
>> examination of the pstore is desirable.
> If you look at the TODO list in our git tree, you'll find that
> importing and flushing pstore has been a long-time TODO list item for
> us.

Hmm does it need to be another full blown coredump?

Looking at his script this should suffice more or less for what he was 
trying to achive no?

Create the tempfile pstore.conf with the following content

d /var/lib/pstore 0755 root root -

and place that file in /etc/tmpfiles.d/

Then create an path type unit - pstore.path with the following content

[Unit]
Description=Monitor the pstore directory for files.
Documentation=https://www.kernel.org/doc/Documentation/ABI/testing/pstore

[Path]
PathModified=/sys/fs/pstore/

And place that file in the /etc/systemd/system directory

Then create type service unit pstore.service with the following content

[Unit]
Description=Move pstore files to persistant storage
Documentation=https://www.kernel.org/doc/Documentation/ABI/testing/pstore

[Service]
ExecStart=/bin/bash -c '/usr/bin/mv -t /var/lib/pstore /sys/fs/pstore/*'
Restart=on-success

And place that file in the /etc/systemd/system directory

Then run systemctl daemon-reload and see if this suffices.

Admins or whomever can then just do the cat to dmesg vodoo on the files 
in /var/lib/pstore if and then when they need it....

JBG

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190115/8d9aea4f/attachment.html>


More information about the systemd-devel mailing list