Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Effects of blocking systemd via INSTALL_MASK
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sun Jan 07, 2018 5:13 pm    Post subject: Reply with quote

According to separate-usr-is-broken (which starts by stating that systemd works fine with separate /usr), the problem is that various projects integrated with udev, but did so in a way that expected /usr to be available. Udev provided only the minimal handling required not to explode when /usr was not available, and those projects would later have strange failures caused by udev skipping their rules when /usr was unavailable. The possible fixes for this were:
  • Declare separate usr to be broken, refuse to support it at all
  • Teach udev how and when to defer usr-requiring rules until after usr was up
  • Stop placing /usr-dependent rules in a context where udev tries to run them before /usr is ready
As in most software projects, declaring a use-case unsupported and refusing to deal with it is by far the easiest solution. Of course, having done that, the political base is laid for the technical changes krinn describes, even though those changes are unnecessary and potentially counterproductive.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Jan 07, 2018 7:16 pm    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

khayyam wrote:
So, system binaries are now located in /lib? Is that the new standard?
[...]
So, /usr/lib is the new standard for configuration files?

jd2066 wrote:
[...] The systemd people shouldn't just come up with new standards, write systemd to use those standards and then just expect everyone to just adopt those standards without any debate but that certainly seems to be what has been happening.

jd2066 ... it's pure hubris ... coupled with brute force. This "modernized subset" is nothing more than doublespeak, and the self-instantiation of whatever "standard" the author(s) might provide to qualify ... with a "legacy this" and "broken that" thrown in to muddy the water.

If you follow the trajectory of some of these changes, then you'll find at the root of it its one change following on as a consequence of some prior action (so, the opposite of design), ie:

Wikipedia: Filesystem_Hierarchy_Standard wrote:
Modern Linux distributions include a /run directory as a temporary filesystem (tmpfs) which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, such data were stored in /var/run but this was a problem in some cases because this directory is not always available at early boot. As a result, these programs have had to resort to trickery, such as using /dev/.udev, /dev/.mdadm, /dev/.systemd or /dev/.mount directories, even though the device directory isn't intended for such data.

So, the problem of having a location for "volatile runtime data" for "early boot" is "solved" ... and now we move /var/run to /run, because ... ummm its "volatile" ... so now we need tmpfiles.d, because the contents of /var/run doesn't survive reboot ... and along comes the next great issue, and solution.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Mon Jan 08, 2018 2:22 am    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

khayyam wrote:
If you follow the trajectory of some of these changes, then you'll find at the root of it its one change following on as a consequence of some prior action (so, the opposite of design), ie:

Wikipedia: Filesystem_Hierarchy_Standard wrote:
Modern Linux distributions include a /run directory as a temporary filesystem (tmpfs) which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, such data were stored in /var/run but this was a problem in some cases because this directory is not always available at early boot. As a result, these programs have had to resort to trickery, such as using /dev/.udev, /dev/.mdadm, /dev/.systemd or /dev/.mount directories, even though the device directory isn't intended for such data.

So, the problem of having a location for "volatile runtime data" for "early boot" is "solved" ... and now we move /var/run to /run, because ... ummm its "volatile" ... so now we need tmpfiles.d, because the contents of /var/run doesn't survive reboot ... and along comes the next great issue, and solution.

I don't really understand what you are talking about here as /run seems to be a good idea that was used by many distros and became part of FHS 3.0.
The Introduction to /run post linked from the wikipedia article lists many good reasons for it's introduction.

It appears, that tmpfiles.d is a separate thing that works on /run, /tmp/, /var/tmp and others for the apparent purpose of having tmp directories known and cleaned up if necessary.
I'm not quite sure on the point of tmpfiles.d but it certainly seems to have a different purpose then the introduction of /run.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jan 08, 2018 1:09 pm    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

jd2066 wrote:
I don't really understand what you are talking about here as /run seems to be a good idea that was used by many distros and became part of FHS 3.0. The Introduction to /run post linked from the wikipedia article lists many good reasons for it's introduction.

jd2066 ... I wasn't arguing /run was a bad idea tout court, I was presenting it's initial rational, a solution for "early boot" (so, in the above, udev, mdadm, etc having some part of the filesystem to write to), and then what followed, its encompassing /var/run, something which previously didn't suffer from the same issues as "early boot", the result being a further "solution" (tmpfiles.d).

jd2066 wrote:
It appears, that tmpfiles.d is a separate thing that works on /run, /tmp/, /var/tmp and others for the apparent purpose of having tmp directories known and cleaned up if necessary. I'm not quite sure on the point of tmpfiles.d but it certainly seems to have a different purpose then the introduction of /run.

It came to encompass those things as result of /run being made available (for "early boot") ... previously those directories would be dealt with via initscripts, or would survive reboots.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Jan 09, 2018 3:15 am    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

khayyam wrote:

jd2066 ... I wasn't arguing /run was a bad idea tout court, I was presenting it's initial rational, a solution for "early boot" (so, in the above, udev, mdadm, etc having some part of the filesystem to write to), and then what followed, its encompassing /var/run, something which previously didn't suffer from the same issues as "early boot", the result being a further "solution" (tmpfiles.d).
[...]
It came to encompass those things as result of /run being made available (for "early boot") ... previously those directories would be dealt with via initscripts, or would survive reboots.

Ok, I'm still not quite understanding here.
Here are the things that were done:
1. /run is created as a tmpfs file system
2. /var/run/ usage switched to /run, /var/lock usage switched to /run/lock, /dev/.[program] usage switched to /run/[program].

If step 1 just stored /run on the root file system instead of mounting as a tmpfs then the end result would likely be the same as I don't think programs creating files there care if the data stored there survives reboots or does not survive reboots.

In fact the data stored there such as pidfiles, current mount information, sockets for programs like screen, etc. are useless after a restart anyways which is probably why the tmpfs was used for /run.

Thinking about it, I don't really know what the point of tmpfiles.d in regards to /run even is as it doesn't seem necessary.

Edit:
I guess I had a brain fart.
I just realized that /run had to be tmpfs or it wouldn't be available in early boot either.
Other then that though, the rest of my post makes sense I think as I'm still not sure on the point of tmpfiles.d in regards to /run.


Last edited by jd2066 on Tue Jan 09, 2018 3:59 am; edited 1 time in total
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Tue Jan 09, 2018 3:32 am    Post subject: Reply with quote

Admitting that I haven't studied these issues but just went with the flow on these changes, I do wonder:

1. Why not leave /var/run as a tmpfs instead of creating /run which didn't have to be at root level because at boot time it only contains trash, if that.
2. Why not switch /var/lock to /var/run/lock so that locks disappear after boot?
3. Can't comment on /dev/.[program] because I never heard of it before, but what are hidden directories/files doing in /dev at all? That's for device files and symlinks to device files.
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Jan 09, 2018 3:45 am    Post subject: Reply with quote

Tony0945 wrote:
Can't comment on /dev/.[program] because I never heard of it before, but what are hidden directories/files doing in /dev at all? That's for device files and symlinks to device files.

From what I understand this format was used by programs like udev, mount, lvm and mdadm that needed to store data somewhere early in the boot process where access to /var may not be available.
I'm not sure but I would assume it was the write access that wasn't always available as I think the root file system is initially mounted as read only when init is started, then after doing thinks like running fsck then the root file system is mounted as read/write.

Tony0945 wrote:
Why not leave /var/run as a tmpfs instead of creating /run which didn't have to be at root level because at boot time it only contains trash, if that.

I guess the reason would be if /var was not part of the root file system and in early boot wasn't mounted yet, the /var/run mount point would not be available
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jan 09, 2018 10:31 am    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

jd2066 ... I think you're missing the point, when things run in early boot they create whatever files they need, whether in /dev/.* or /run/* it matters not (except perhaps that /dev/ isn't intended for such things) ... /run makes perfect sense in this regard. But some programs (not part of "early boot") expect a filesystem, and don't create that filesystem, because they have hitherto been served by the non-volatile nature of /var/ or were sufficiently handled by initscripts. So, by relocating /var/run to /run you require there be some mechanism to create this filesystem, as this may previously had been handled via initscripts, or via the package manager. Now, what mechanism should this be? The package manager can't help (except perhaps install something to tmpfiles.d) because the filesystem in question doesn't survive reboots. Initscripts then, as that's their purpose (to bring the system/service up into a working state), but systemd doesn't have initscripts, and systemd is the "standard" for how things should be done ... so, we come to tmpfiles.d.

You might want to 'grep checkpath /etc/init.d/*' and look see what's done for /var/ and/or /run. You'll probably see that for most cases we are making sure the required filesystem is available, and has the correct ownership/permissions. Similarly with other tasks, clearing /tmp for instance.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Jan 09, 2018 11:26 am    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

khayyam wrote:
jd2066 ... I think you're missing the point, when things run in early boot they create whatever files they need, whether in /dev/.* or /run/* it matters not (except perhaps that /dev/ isn't intended for such things) ... /run makes perfect sense in this regard. But some programs (not part of "early boot") expect a filesystem, and don't create that filesystem, because they have hitherto been served by the non-volatile nature of /var/ or were sufficiently handled by initscripts. So, by relocating /var/run to /run you require there be some mechanism to create this filesystem, as this may previously had been handled via initscripts, or via the package manager. Now, what mechanism should this be? The package manager can't help (except perhaps install something to tmpfiles.d) because the filesystem in question doesn't survive reboots. Initscripts then, as that's their purpose (to bring the system/service up into a working state), but systemd doesn't have initscripts, and systemd is the "standard" for how things should be done ... so, we come to tmpfiles.d.
You might want to 'grep checkpath /etc/init.d/*' and look see what's done for /var/ and/or /run. You'll probably see that for most cases we are making sure the required filesystem is available, and has the correct ownership/permissions. Similarly with other tasks, clearing /tmp for instance.

So if I got this correctly:
* When /var/run and /var/lock existed as regular directories, the package manager created any required subdirectories and set permissions on them
* With /run as a tmpfs, instead of the package manager doing that, init scripts are required to create any required subdirectories and set permissions on them.
* This works different in systemd because unit files are not shell scripts.

It doesn't seem to change much though, according to the systemd.exec man page a unit file can have directories it uses created via the options "RuntimeDirectory=, StateDirectory=, CacheDirectory=, LogsDirectory=, ConfigurationDirectory=".
It appears tmpfiles.d is only needed if a configuration is more complex that those options provide or it's for programs that don't use init scripts or unit files like screen that need to use it so they have a directory in /run that is writable for it.
Otherwise, the program would need to use a world writable directory like /tmp for it's data.

So it seems /run was created and other things were updated to deal with that changes between it and the older locations.
I don't really see the problem with this as I don't really see what else they could have done.
I suppose /run could have been created just for early boot stuff only and the /var/run + /var/lock directories could have stayed the way it was.
That would be less then ideal though as the location of runtime data would be dependent on if the program needed to be used in early boot or not.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jan 09, 2018 12:45 pm    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

jd2066 ... again, I think you're missing the point, you seem to be looking at this from the point of view of what systemd does, when for me, my focus is on what my system is doing, or needs to do (and the best methods to achieve that). Yes, it may have been the package manager, or the initscript, that provided the filesystem prior to their relocation to /run, but the question is what is the actual benefit (to me) with the introduction of tmpfiles.d? Was something "broken" previously, and is this mechanism more robust? IMO, no, there wasn't a problem that necessarily needed solving, and practically the only instances of which I read there being one (ie, "screen") these are cases under which the application, or user, should change (ie, 'TMPDIR=~/tmp screen') ... if only because the negatives of the change outweigh the positives.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Jan 09, 2018 2:18 pm    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

khayyam wrote:
jd2066 ... again, I think you're missing the point, you seem to be looking at this from the point of view of what systemd does, when for me, my focus is on what my system is doing, or needs to do (and the best methods to achieve that). Yes, it may have been the package manager, or the initscript, that provided the filesystem prior to their relocation to /run, but the question is what is the actual benefit (to me) with the introduction of tmpfiles.d? Was something "broken" previously, and is this mechanism more robust? IMO, no, there wasn't a problem that necessarily needed solving, and practically the only instances of which I read there being one (ie, "screen") these are cases under which the application, or user, should change (ie, 'TMPDIR=~/tmp screen') ... if only because the negatives of the change outweigh the positives.

So the problem is that you just don't see the benefit of tmpfiles.d (and possibly the /run introduction, not sure)?
I'm not really sure what to say about that as in theory any change that doesn't benefit a specific user can be seen as having no point by that user but that doesn't mean the change doesn't benefit some users.

I just became aware of tmpfiles.d a few days ago when the topic came up and I don't even have opentempfiles installed so I don't know much about it.
Besides the systemd man pages I've looked at, I'm not really sure of the benefit.

It seems the reasoning is so that temp files used by programs in temporary directories are pre-created if needed and auto removed after a specific period of time so the admin can be sure the temp files are properly setup and removed to avoid old temp files laying around.
Though /run is tmpfs and the systemd man page on file hierarchy appears to recommend /tmp be a tmpfs so cleaning up the files in those directories seems a little pointless.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Tue Jan 09, 2018 2:31 pm    Post subject: Reply with quote

I think you are missing some point:
- /dev was use to store early boot infos ; but it was bad, first because you start adding more and more .something in /dev that is not related devices, but they were doing that because udev was using /dev on tmpfs, which is broken from the very start, because you are using /dev assuming it is tmpfs, which is only true if udev handle it ; static /dev does not do that.
- /var/run was a bad answer to that: they saw they need to have a dedicated tmpfs to handle early boot processing, but they pickup /var/run which is totally wrong: /var may get mount later from another disk/partition or nfs, if anyone mount /var/run as tmpfs and write early boot datas in it, once the real /var is mount, all the informations are lost.
- /run is the only correct answer: you make a tmpfs that even static /dev user will create, it is a direct directory depending on / which is the only 100% sure mount point that will be always there, it is a directory that LFSH didn't speak of prior to its creation, and as such nobody should had use that directory (so you are avoiding using /run that was use for something, and avoid anyone mount /run after boot) ; assuming everyone has comply with LFSH and wasn't using stupid subdir names in their /
- tmpfiles.d is another stupid creation made on a not bad idea:
program need temp file, they need them when they run, but don't care i they doesn't exists when they start.
but using temp file is not that easy:
You have to use a file nobody is using already, to not fuck the other program, and to prevent the other program doing the same on you. No big deal you check filename exists and if not, it's for you.

But you have an issue: when your program crash (or someone doesn't remove the file on program exit), the file remain in /tmp, and on your next run, you will see the file exists and pickup another name.
and /tmp start to get unused files (which might be big) and the system is loosing space.
You can mitigate this in two ways:
* clean /tmp when you boot, but the problem is that you do that only when you boot (funny it shouldn't be a problem at all for a server using systemd, as any update to systemd need a reboot) ; so it's a false problem to clean /tmp only on boot for systemd, because rebooting should happen a lot. But it could be one for a system that is running for a long time without reboot.
* clean /tmp every X delays (say, using cron), but you have no idea if the file is "still in use", you are remove a file from /tmp that a program is using, it's not because the file is X days old that the file is not use.

To solve this, systemd introduce tmpfiles.d but as usual with systemd, it has done shit again.
So they say: we will not allow anyone to clean /tmp and we will delegate that task to tmpfiles.d, program install a "tmpfiles config" and tell their usage of a temp file (how much time the file should survive), and tmpfiles.d create wanted file for the program with wanted attributes (mode, uid and gid), and handle the cleaning thru an "age" value.

This is totally stupid:
- this doesn't solve filename clash, programs ask tmpfiles to create /tmp/this but if /tmp/this already exists with the good properties, you shouldn't use it, but tmpfiles.d will not handle the clash, it's still upto your program to do that.
sshd ask "/tmp/sshd_1", tmpfiles.d answer "no, this file exists", then it's still upto sshd to then redo, "ok what about /tmp/ssh_d2 then", and tmpfiles.d will say "yes or no".

In theory it works, after few times, /tmp/sshd_1 will reach its age limit, and so tmpfiles.d will clean /tmp/sshd_1
But this is totally broken, it mean if your running sshd is using /tmp/sshd_1 and it has reach its age limit, good bye /tmp/sshd_1 and go luck to handle that ; while virtual fs will keep its content for sshd, you won't see it yourself, and /tmp/sshd_1 content may still be "ok" for sshd because it was using /tmp/sshd_1 and set its content to "ok", but if you look at /tmp/ssd_1 content yourself, you will see its actual content, that is the content another ssh_d instance is using and have set to "not ok".
so you have an sshd pid10 using /tmp/sshd_1 and set "ok" in it, and after x time, tmpfiles.d has remove the file, you start another sshd with pid2000 and it reuse the file (because the file no more exists for sshd pid2000, while still sshd pid10 is still using it!) and set it to "not ok". But when you look at the file content you will see it's "actual" state, so you see "not ok" yourself.
Not only it will harder debug, but it's prone to errors and security issue.
So this is a an issue for an file that you have keep open.

But if your program close the file to reuse it later, it's worst.
You create the file, use it, close it, and reopen it later again (you don't delete it, you will need its content later).
This time virtual fs won't come to your help: sshd create "/tmp/sshd_1", use it, close it, do some stuff, tmpfiles.d see "/tmp/sshd_1" has reach age limit and clean it ; now your sshd will try reopen the file to reuse what you have stored in it ; but wait, the file is gone! Good luck handling that...

Because stupidity has no limit with systemd, they also think, "oh but what about files we have no config for?" and the result is:
default rule in systemd: if a file age is 30 days and no config exists, clean it.
And that's the issue portage has get, in order to save /var/tmp/ccache from cleaning by this stupid rule, they want add a portage_ccache tmpfiles kind of config file to say "stop cleaning /var/tmp/ccache every 30 days"

Instead of gay config files everywhere for each program, it should had use a centralized base itself and handle file creation/deletion and pid owner.
It would had been nice that your program would do
hey tempfiles.d, i need a temp file, tmpfiles.d choose itself the filename (handle name clash and in use file), create the filename... and return "ok here's the one you will use".
no age limit: each time tmpfiles.d gave a filename, it record: ok i have create file "z" for sshd-pid34, if next time someone ask me something, i will check that sshd-pid34 is still running and if not, and the file is still there, i'll clean it.
if anyone ask me a file, i will make sure to gave him back a file name that doesn't exists.

no need for config file everywhere, tmpfiles.d would use a database to keep file use by each pid.
and a default sane rule with : if i see a file in /tmp, if i know i have create this file, and if the program/pid that has ask me that file is no more running, i'll delete it.
This way, if tmpfiles.d see a file that wasn't create by it, it keep it, if it is one it has create, it clean it if the pid owner is no more running.

And you don't gives a fuck if pid is running since two years or if a file in /tmp is 10 years old or not, still, you are able to recover space from /tmp for each file tmpfiles.d has been ask to create, and you never remove a file that is use by a running program. And if the program crash or forget to ask it delete, tmpfiles.d is able to clean it by itself ; and this without removing a file that is in use, and without removing a file that you don't handle and that may be important even nobody has telling you about it, and still ease temp files name creation and deletion, with the benefits to claiming back space from no more used files.

Not a bad idea at first, but badly implemented, and again with tones of .conf files everywhere for nothing in the pure spirit of .ini files Windows love.
ps: note that i have no idea how systemd-tmpfiles is implement really, that's only how it is implemented in opentmpfiles.d, which mean, systemd version might not be as useless as openrc one.
Like it is actually, it's only value is : create a configfile that set age value of a cache file, and when age is reach, clean it so the cache file is force to refresh ; however, even in this case, it mean the cache file could be clean while the program is trying to use it, with unexpected results and "racing condition" bugs, totally lame.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Tue Jan 09, 2018 2:38 pm    Post subject: Reply with quote

jd2066 wrote:
I guess the reason would be if /var was not part of the root file system and in early boot wasn't mounted yet, the /var/run mount point would not be available
So we changed so that we could have a seperate /var, but no longer having a seperate /usr is OK? It sounds like reasons are manufactured after the decision is made. And the real reason for the decision is change for the sake of change and to disrupt existing systems Not Invented Here.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jan 09, 2018 3:10 pm    Post subject: Re: Effects of blocking systemd via INSTALL_MASK Reply with quote

jd2066 wrote:
So the problem is that you just don't see the benefit of tmpfiles.d (and possibly the /run introduction, not sure)?

jd2066 ... please read more carefully, I've now stated "I wasn't arguing /run was a bad idea tout court", and "/run makes perfect sense in this regard", so I fail to see why you are "not sure" ITR, or why you're consistently either not following my argument, and/or failing to connect the dots. So, to reiterate (WRT tmpfiles.d) : was something "broken" previously, and is this mechanism more robust?

jd2066 wrote:
I'm not really sure what to say about that as in theory any change that doesn't benefit a specific user can be seen as having no point by that user but that doesn't mean the change doesn't benefit some users.

That wasn't my argument, go back to where I came into this discussion WRT "standards", and relatedly "design". I'm concerned about my own specific situation because the introduction of said "standards" encroach upon my usage (and the sort of robust setup I've grown use to). As for others, they can make what they want of it, but they had better have a good technical argument if they want me to adopt, and/or validate, it.

As for the rest I'm not going to repeat myself.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Wed Jan 10, 2018 12:57 am    Post subject: Reply with quote

krinn wrote:
I think you are missing some point:
- /dev was use to store early boot infos ; but it was bad, first because you start adding more and more .something in /dev that is not related devices, but they were doing that because udev was using /dev on tmpfs, which is broken from the very start, because you are using /dev assuming it is tmpfs, which is only true if udev handle it ; static /dev does not do that.
- /var/run was a bad answer to that: they saw they need to have a dedicated tmpfs to handle early boot processing, but they pickup /var/run which is totally wrong: /var may get mount later from another disk/partition or nfs, if anyone mount /var/run as tmpfs and write early boot datas in it, once the real /var is mount, all the informations are lost.
- /run is the only correct answer: you make a tmpfs that even static /dev user will create, it is a direct directory depending on / which is the only 100% sure mount point that will be always there, it is a directory that LFSH didn't speak of prior to its creation, and as such nobody should had use that directory (so you are avoiding using /run that was use for something, and avoid anyone mount /run after boot) ; assuming everyone has comply with LFSH and wasn't using stupid subdir names in their /

I did understand this already and saw the /run was really the only answer to the problems that existed.
I had thought from an earlier post that khayyam didn't like /run for some reason but it seems I was incorrect.

khayyam wrote:
jd2066 ... please read more carefully, I've now stated "I wasn't arguing /run was a bad idea tout court", and "/run makes perfect sense in this regard", so I fail to see why you are "not sure" ITR, or why you're consistently either not following my argument, and/or failing to connect the dots. So, to reiterate (WRT tmpfiles.d) : was something "broken" previously, and is this mechanism more robust?

It appears I have interpreted your first message about this incorrectly.

The first message on /run and tmpfiles.d you posted that I was responding to was this:
khayyam wrote:
So, the problem of having a location for "volatile runtime data" for "early boot" is "solved" ... and now we move /var/run to /run, because ... ummm its "volatile" ... so now we need tmpfiles.d, because the contents of /var/run doesn't survive reboot ... and along comes the next great issue, and solution.

You listed two issues (The move to /run and the creation of tmpfiles.d) and ended with "and along comes the next great issue, and solution" which I had interpreted to mean you thought both were pointless solutions to non-issues.

It appears I interpreted that wrong and it is only tmpfiles.d that you don't see the point of.
In which case I don't have much response because I'm still trying to figure out what tmpfiles.d was trying to solve and if it did so it a way that makes sense.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jan 10, 2018 11:29 am    Post subject: Reply with quote

jd2066 wrote:
It appears I interpreted that wrong and it is only tmpfiles.d that you don't see the point of.

jd2066 ... I'd thought that as we were talking initially about standards, WRT tmpfiles.d, and had stated in that same post "[...] as a consequence of some prior action", then the "prior action" was obviously relocating /var/run to /run (not the instanciation of /run itself). All that should have been clear from my next post. What I was pointing to is the willy-nilly way in which such things come about.

jd2066 wrote:
In which case I don't have much response because I'm still trying to figure out what tmpfiles.d was trying to solve and if it did so it a way that makes sense.

I think that's been covered, someone had a "good idea", and then it became standard. It doesn't solve anything, no one was suffering the detrimental effects of /var/run being non-volatile ... because the distribution (packagers, initscript authors) dealt with it. Hence my question, was something "broken" previously, and is this mechanism more robust?

BTW, krinn makes some good points above, certainly things can always be improved, but I tend to err on the side of "if it 'aint broke", because what I most care about is that "this" machine will function correctly. Change is always a balance between disruption and benefit, and not the result of someone having a "good idea" and deciding this will be the standard for the week.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Wed Jan 10, 2018 2:27 pm    Post subject: Reply with quote

khayyam wrote:
jd2066 ... I'd thought that as we were talking initially about standards, WRT tmpfiles.d, and had stated in that same post "[...] as a consequence of some prior action", then the "prior action" was obviously relocating /var/run to /run (not the instanciation of /run itself). All that should have been clear from my next post. What I was pointing to is the willy-nilly way in which such things come about.
[...]
I think that's been covered, someone had a "good idea", and then it became standard. It doesn't solve anything, no one was suffering the detrimental effects of /var/run being non-volatile ... because the distribution (packagers, initscript authors) dealt with it. Hence my question, was something "broken" previously, and is this mechanism more robust?

It appears you have the action order incorrect.
I looked on the systemd Github and it appears tmpfiles.d was added on Sep 28, 2010 and support for /run was added on Mar 24, 2011.
Before the introduction of /run, tmpfiles.d had default configuration listing some files and directories in /tmp, /var/tmp and /var/run among others.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Wed Jan 10, 2018 2:32 pm    Post subject: Reply with quote

khayyam wrote:
BTW, krinn makes some good points above, certainly things can always be improved, but I tend to err on the side of "if it 'aint broke"

Like i said, it's not a bad idea because it will indeed things something broken: if you let /tmp gets fill with unused files, your server won't like to have no more disk space.
But the irony is that, imo, this scenario is close to impossible to met if you use systemd (you will certainly need to reboot before your /tmp is full).
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jan 10, 2018 2:54 pm    Post subject: Reply with quote

jd2066 wrote:
It appears you have the action order incorrect. I looked on the systemd Github and it appears tmpfiles.d was added on Sep 28, 2010 and support for /run was added on Mar 24, 2011. Before the introduction of /run, tmpfiles.d had default configuration listing some files and directories in /tmp, /var/tmp and /var/run among others.

jd2066 ... whatever it was doing prior to Mar 24, 2011 doesn't matter, /var/run wasn't volitile, and didn't point to /run. So, if the thought was "we can migrate /var/run to /run because we have tmpfiles.d" or "having migrated /var/run to /run tmpfiles.d is needed" matters very little.

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Wed Jan 10, 2018 2:56 pm    Post subject: Reply with quote

krinn wrote:
But the irony is that, imo, this scenario is close to impossible to met if you use systemd (you will certainly need to reboot before your /tmp is full).

Based on that, it sounds like you are saying that using systemd makes the need for reboots more frequent.
If that is the case, I'm curious to know why that is.
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Wed Jan 10, 2018 3:02 pm    Post subject: Reply with quote

khayyam wrote:
jd2066 wrote:
It appears you have the action order incorrect. I looked on the systemd Github and it appears tmpfiles.d was added on Sep 28, 2010 and support for /run was added on Mar 24, 2011. Before the introduction of /run, tmpfiles.d had default configuration listing some files and directories in /tmp, /var/tmp and /var/run among others.

jd2066 ... whatever it was doing prior to Mar 24, 2011 doesn't matter, /var/run wasn't volitile, and didn't point to /run. So, if the thought was "we can migrate /var/run to /run because we have tmpfiles.d" or "having migrated /var/run to /run tmpfiles.d is needed" matters very little.

It seems you have now missed my point which is that the switch to using /run had nothing to do with the existence of tmpfiles.d.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jan 10, 2018 3:12 pm    Post subject: Reply with quote

jd2066 wrote:
It seems you have now missed my point which is that the switch to using /run had nothing to do with the existence of tmpfiles.d.

jd2066 ... not at all, I don't think I made the claim that "the switch to using /run had" something "to do with the existence of tmpfiles.d."

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Thu Jan 11, 2018 12:14 am    Post subject: Reply with quote

khayyam: I have tried to understand what point you were you attempting to convey with your posts but still just don't get it.
I think I'll just have to end this discussion as it seems to be a fruitless discussion.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Jan 11, 2018 12:53 pm    Post subject: Reply with quote

jd2066 wrote:
khayyam: I have tried to understand what point you were you attempting to convey with your posts but still just don't get it. I think I'll just have to end this discussion as it seems to be a fruitless discussion.

jd2066 ... well, from my perspective you've been placing the onus on me for justification of my criticism, when any question I've posed goes unanswered, and its these questions which are at the crux of the issue, not which came first, "action orders", etc, etc. I've seen it often enough to have grown wary of it, it's a technique know as the tarpit, any discussion can be made lifeless by focusing on how a statement is made, or other minute details, and so suck the energy of your interlocutor ... I just did the very same thing in return!

My argument has been fairly clear from the outset, firstly, what are the standards involved (why are system binaries in /lib ... or config files in /usr/lib) and who is setting them, and for what reason. Secondly, does the introduction of said standards, and/or mechanisms (specifically tmpfiles.d), solve an actual problem, and does the solution make the system more robust. So, if you can answer to those particular arguments, then we are having a discussion, otherwise, if you pick around the edges, then it is, as you say, "fruitless".

best ... khay
Back to top
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Thu Jan 11, 2018 2:48 pm    Post subject: Reply with quote

khayyam wrote:
jd2066 ... well, from my perspective you've been placing the onus on me for justification of my criticism, when any question I've posed goes unanswered, and its these questions which are at the crux of the issue, not which came first, "action orders", etc, etc. I've seen it often enough to have grown wary of it, it's a technique know as the tarpit, any discussion can be made lifeless by focusing on how a statement is made, or other minute details, and so suck the energy of your interlocutor ... I just did the very same thing in return!

Huh, interesting. I certainly didn't intend to do that but maybe I did without realizing it.

khayyam wrote:

My argument has been fairly clear from the outset, firstly, what are the standards involved (why are system binaries in /lib ... or config files in /usr/lib) and who is setting them, and for what reason. Secondly, does the introduction of said standards, and/or mechanisms (specifically tmpfiles.d), solve an actual problem, and does the solution make the system more robust. So, if you can answer to those particular arguments, then we are having a discussion, otherwise, if you pick around the edges, then it is, as you say, "fruitless".

Oh, I get it now.
Your argument wasn't specifically about systemd or it's components but rather any developers of a piece of software that uses their own ideas for how something should work because they think it's best even when the idea is not better then the current standard or is better but not enough to make it worth bothering with.
Thus the point was more about mentioning systemd and it's components as an example of this happening instead of being the argument being restricted to why certain things were done and if there was a good idea behind them.

One simple example of that being the move from /sbin/runscript to /sbin/openrc-run for openrc init scripts.
Having a better name that is less generic is a good idea but the effort required to update every init script to use it likely was not worth it.
Checking on my system, it appears all my init scripts do use the new path but likely for compatibility my system still a /sbin/runscript file (That diff -s reports is identical to the binary file as /sbin/openrc-run).

As for the systemd file system layout idea, I don't know what to say because I'm not sure it makes since.

On the usefulness of systemd-tmpfiles (The daemon that carries out the actions specified in tmpfiles.d), it does seem to have a purpose.
Most programs that use temporary files, end up creating and removing the files themselves unless the files needs to be pre-created with specific permissions then the init script or package manager takes care of that.
This works ok though if a program doesn't remove the tmp file due to a crash for instance then you can have unused tmp files hanging around doing nothing.

The idea of systemd-tmpfiles is that instead of having programs handle the creation/deletion of their tmpfiles or having the package manager/init scripts handle the creation/deletion of the tmpfiles, just have a daemon that handles those things for you so tmpfiles creation and deletion is all done by a centralized system that in theory results in better management and cleaning of tmpfiles that will be beneficial to the system administrator who doesn't need to clean up old tmp files as that is handled automatically.

I'm not sure if opentmpfiles works the same way though as it doesn't appear to be a deamon that stays running in the background so I'm not sure if it can function in the same way or not.

So far in my system administration of a Gentoo Linux system with openrc, the lack of automatic tmpfiles management hasn't really seemed to be an much of an issue.
There maybe some tmpfiles that got left in /tmp but it doesn't seem to really cause any issues to just ignore it (unless the tmp files are really big for some reason) so I'm not sure of the necessity of the systemd-tmpfiles daemon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum