Re: [systemd-devel] what is sd_notify() really for ?

2017-04-16 Thread Enrico Weigelt, metux IT consult
On 17.04.2017 00:04, Lennart Poettering wrote:

> Please always check the man pages if you have questions regarding a
> specific systemd interface:
> 
> https://www.freedesktop.org/software/systemd/man/sd_notify.html

Done so, of course. Unfortunately, it doesn't answer my questions,
eg. what the service manager actually does w/ that information.


--mtx

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] what is sd_notify() really for ?

2017-04-16 Thread Enrico Weigelt, metux IT consult
Hi folks,


I just wonder what sd_notify()+friends is really for. What does the
service manager actually do with that information?

Is this just informational or does it do certain decisions (eg.
starting/stopping other depending services, etc) on that ?

Is this somehow related to systems monitoring (like eg.nagios does) ?

What is the meaning of the optional PID here ? Can one process send
notifications on behalf of another ?

A few examples of real world usecases would be very helpful.


thx.

--mtx
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] what is sd_notify() really for ?

2017-04-16 Thread Lennart Poettering
On Sun, 16.04.17 23:48, Enrico Weigelt, metux IT consult 
(enrico.weig...@gr13.net) wrote:

> Hi folks,
> 
> 
> I just wonder what sd_notify()+friends is really for. What does the
> service manager actually do with that information?
> 
> Is this just informational or does it do certain decisions (eg.
> starting/stopping other depending services, etc) on that ?
> 
> Is this somehow related to systems monitoring (like eg.nagios does) ?
> 
> What is the meaning of the optional PID here ? Can one process send
> notifications on behalf of another ?
> 
> A few examples of real world usecases would be very helpful.

Please always check the man pages if you have questions regarding a
specific systemd interface:

https://www.freedesktop.org/software/systemd/man/sd_notify.html

It provides an overview of the various messages, and comes with
examples. It should answer all your questions.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] journal fragmentation on Btrfs

2017-04-16 Thread Chris Murphy
Hi,

This is on a Fedora 26 workstation (systemd-233-3.fc26.x86_64) that's
maybe a couple weeks old and was clean installed. Drive is NVMe.


# filefrag *
system.journal: 9283 extents found
user-1000.journal: 3437 extents found
# lsattr
C-- ./system.journal
C-- ./user-1000.journal

I do manual snapshots before software updates, which means new writes
to these files are subject to COW, but additional writes to the same
extents are overwrites and are not COW because of chattr +C. I've used
this same strategy for a long time, since systemd-journald defaults to
+C for journal files; but I've not seen them get this fragmented this
quickly.

Meanwhile on a Fedora 25 Server, which has systemd-231-14.fc25.x86_64,
and SD Card based, I've made a modification where /var/log is a nested
subvolume so that when I snapshot the root subvolume, the contents of
/var/log are not snapshot, therefore these files should always be
no-COW, and yet they too are rather fragmented.

# filefrag *
system@00054c130c57bb79-5df6c2871d1edf1e.journal~: 1 extent found
system@00054cb3cd18d71b-6a815220d62cc6ea.journal~: 1 extent found
system@01b44589014542e3b48df31f152c0916-0001-000542e1fb4550e7.journal:
1 extent found
system@01b44589014542e3b48df31f152c0916-ca2b-00054546539416e8.journal:
1 extent found
system@01b44589014542e3b48df31f152c0916-000198f3-000547aac217c85b.journal:
1 extent found
system.journal: 2992 extents found
user-1000@00054c130a314ee9-4bb9fd0a9268dc1c.journal~: 1 extent found
user-1000@ac4b2e5ded7d4e0dbcac6fc45430c857-05a9-000542e1fe209094.journal:
1 extent found
user-1000@ac4b2e5ded7d4e0dbcac6fc45430c857-cafe-0005454b13a0349f.journal:
1 extent found
user-1000@ac4b2e5ded7d4e0dbcac6fc45430c857-0001abe0-0005482397f286a5.journal:
1 extent found
user-1000.journal: 405 extents found

There are many 4096 byte extents is what's going on. Maybe this is a
consequence of frequent fsync?

On the plus side, even a 'reboot -f' or forced power off, and I get
pretty much everything within the last few seconds in the journal on
the next boot. That's pretty good. Maybe to do better is too much
hassle - like no fsyncing on Btrfs and just let its normal 30s commit
time apply; if things start crashing then journald could start
fsyncing... some sort of dynamic trigger.

There could be 8000 things higher priority than this though, this isn't broken.

Output from
# filefrag -v system.journal
# btrfs-debugfs -f system.journal

https://drive.google.com/open?id=0B_2Asp8DGjJ9UEdyVFRfU0c2V2s


-- 
Chris Murphy
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel