hw
2017-Oct-03 17:12 UTC
[CentOS] how to prevent files and directories from being deleted?
Alexander Dalloz <ad+lists at uni-x.org> writes:> Am 01.10.2017 um 17:21 schrieb hw: >> Hi, >> >> how can I prevent files/directories like /var/run/mariadb from being >> deleted on reboot? Lighttpd has the same problem. >> >> This breaks services and makes servers non-restartable by anyone else >> but the administrator who needs to re-create the needed files and >> directories every time and has to figure out what selinux labels they >> need. This causes unnecessary downtimes. >> >> This is entirely inacceptable. This totally sucks. > > See > > https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7/ > > how to manage tmpfiles.Thanks, I?ll look into that. I wouldn?t consider a directory like /var/run/mariadb in any way as only temporary --- and wouldn?t consider directories that are required for the system to work as temporary, either.> Curious, how did you install MariaDB that you have such a problem? The > package shipping with CentOS does not create such issue.I?m using the packages from mariadb.org. The old version that comes in Centos isn?t recommended, and I need features only the newer versions provide. Lighttpd is from epel, and it has basically the same issue. -- "Didn't work" is an error.
Mark Haney
2017-Oct-03 17:24 UTC
[CentOS] how to prevent files and directories from being deleted?
On 10/03/2017 01:12 PM, hw wrote:> >> See >> >> https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7/ >> >> how to manage tmpfiles. > Thanks, I?ll look into that. I wouldn?t consider a directory like > /var/run/mariadb in any way as only temporary --- and wouldn?t consider > directories that are required for the system to work as temporary, > either.That directory isn't temporary.? The files almost always are, but not the directories.? As I said, whatever it is you're doing, it's wrong.? I wouldn't continue to keep a setup like that as it's not standard practice to keep data in /var/run that isn't temporary. However, you seem to be insistent on doing things contrary to best practices so.....>> Curious, how did you install MariaDB that you have such a problem? The >> package shipping with CentOS does not create such issue. > I?m using the packages from mariadb.org. The old version that comes in > Centos isn?t recommended, and I need features only the newer versions > provide. > > > Lighttpd is from epel, and it has basically the same issue. > >What issue? That the PID is dropped on reboot?? What else are you putting in there?? I'm beginning to question whether you know what you're doing or not.? Lighttpd doesn't store any persistent info in /var/run/ because, like everything else, /var/run isn't for persistent data. -- Mark Haney Network Engineer at NeoNova 919-460-3330 option 1 mark.haney at neonova.net www.neonova.net
Paul Heinlein
2017-Oct-03 17:35 UTC
[CentOS] how to prevent files and directories from being deleted?
On Tue, 3 Oct 2017, hw wrote:> Alexander Dalloz <ad+lists at uni-x.org> writes: > >> Am 01.10.2017 um 17:21 schrieb hw: >>> Hi, >>> >>> how can I prevent files/directories like /var/run/mariadb from >>> being deleted on reboot? Lighttpd has the same problem. >>> >>> This breaks services and makes servers non-restartable by anyone >>> else but the administrator who needs to re-create the needed files >>> and directories every time and has to figure out what selinux >>> labels they need. This causes unnecessary downtimes. >>> >>> This is entirely inacceptable. This totally sucks.On CentOS 7 machines, the /run mountpoint (available via symlink as /var/run) is a temporary filesystem. Try "df -h /run" to see for yourself. That whole directory lives in memory. Using systemd-tmpfiles is the most reliable method for ensuring your /run directories are created and given correct perms at boot. The syntax for /etc/tmpfiles.d/*.conf isn't terribly difficult, and the files there are easy to manage. See the tmpfiles.d(5) man page for details and examples. Once your file is in place, you can activate it without messing with other temp files: systemd-tmpfiles --create /etc/tmpfiles.d/your.conf -- Paul Heinlein heinlein at madboa.com 45?38' N, 122?6' W
Jonathan Billings
2017-Oct-04 00:53 UTC
[CentOS] how to prevent files and directories from being deleted?
On Oct 3, 2017, at 13:12, hw <hw at adminart.net> wrote:> > I?m using the packages from mariadb.org. The old version that comes in > Centos isn?t recommended, and I need features only the newer versions > provide. > > > Lighttpd is from epel, and it has basically the same issue.If the mariadb.org package thinks /var/run is persistent, then it?s not intended for CentOS7. If the EPEL package did too, then there could be serious problems with that package. However, I see that it has a /usr/lib/tmpfiles.d/lighttpd.conf, so it is ok. -- Jonathan Billings
Gary Stainburn
2017-Oct-04 08:23 UTC
[CentOS] how to prevent files and directories from being deleted?
On Tuesday 03 October 2017 18:24:01 Mark Haney wrote:> What issue? That the PID is dropped on reboot?? What else are you > putting in there?? I'm beginning to question whether you know what > you're doing or not.? Lighttpd doesn't store any persistent info in > /var/run/ because, like everything else, /var/run isn't for persistent > data.Mark, Many Non-Centos originated packages create directories in /var/run as part of the install, and expect them to still exist after a reboot. They then fail when starting the service because they're trying to create a PID / Lock file in a directory that no longer exists. This problem has been around ever since /var/run was moved to tmpfs. Unfortunately, sometimes we have to use packages other than the official Centos ones, usually as in this case because we need newer versions. There is a solution that saves /var/run to disk at shutdown and restores it at bootup but I can't remember what it is.
hw
2017-Oct-05 09:32 UTC
[CentOS] how to prevent files and directories from being deleted?
Mark Haney <mark.haney at neonova.net> writes:> On 10/03/2017 01:12 PM, hw wrote: >> >>> See >>> >>> https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7/ >>> >>> how to manage tmpfiles. >> Thanks, I?ll look into that. I wouldn?t consider a directory like >> /var/run/mariadb in any way as only temporary --- and wouldn?t consider >> directories that are required for the system to work as temporary, >> either. > That directory isn't temporary.? The files almost always are, but not > the directories.? As I said, whatever it is you're doing, it's wrong.? > I wouldn't continue to keep a setup like that as it's not standard > practice to keep data in /var/run that isn't temporary.Well, what am I supposed to do? The socket (or what it was) needs to be put somewhere, and IIRC, it wasn?t my choice to put it there but is a default. With mariadb, there are some defaults you can?t reasonably change because other software expects files where they usually are. And I don?t want to change that, I just want mariadb and lighttpd and other things to start on reboots rather than being broken because someone decided that files/directories they require are to be deleted on reboots before they can start.> However, you seem to be insistent on doing things contrary to best > practices so..... >>> Curious, how did you install MariaDB that you have such a problem? The >>> package shipping with CentOS does not create such issue. >> I?m using the packages from mariadb.org. The old version that comes in >> Centos isn?t recommended, and I need features only the newer versions >> provide. >> >> >> Lighttpd is from epel, and it has basically the same issue. >> >> > What issue? That the PID is dropped on reboot?? What else are you > putting in there?? I'm beginning to question whether you know what > you're doing or not.? Lighttpd doesn't store any persistent info in > /var/run/ because, like everything else, /var/run isn't for persistent > data.IIRC, lighttpd won?t start unless you mess with where it puts its pid file. I think I had to resort to put it into /tmp or something like that because the place where it?s supposed to put it gets deleted on reboots. I?ve never before had issues like this. -- "Didn't work" is an error.
hw
2017-Oct-09 12:06 UTC
[CentOS] how to prevent files and directories from being deleted?
Jonathan Billings <billings at negate.org> writes:> On Oct 3, 2017, at 13:12, hw <hw at adminart.net> wrote: >> >> I?m using the packages from mariadb.org. The old version that comes in >> Centos isn?t recommended, and I need features only the newer versions >> provide. >> >> >> Lighttpd is from epel, and it has basically the same issue. > > If the mariadb.org package thinks /var/run is persistent, then it?s not intended for CentOS7.Or it is intended for Centos and not done how it needs to be because Centos differs from the FHS ...> If the EPEL package did too, then there could be serious problems with > that package. However, I see that it has a > /usr/lib/tmpfiles.d/lighttpd.conf, so it is ok.Hm, then how come it?s so troublesome? I have /usr/lib/tmpfiles.d/httpd.conf. It seems to have remained because I had httpd (which is apache) installed and then switched to lighttpd and removed httpd. httpd is no longer installed. The only installed package referring to it is apache-commons-logging, and I don?t know why it hasn?t been removed. The contents of /usr/lib/tmpfiles.d/httpd.conf indicate that this file is for apache. Why hasn?t this file been removed when httpd was removed? There is no file lighttpd.conf in /usr/lib/tmpfiles.d. Does this mean that both packages, httpd and lighttpd, have serious problems because they do not remove and do not install files correctly? -- "Didn't work" is an error.
Seemingly Similar Threads
- how to prevent files and directories from being deleted?
- how to prevent files and directories from being deleted?
- how to prevent files and directories from being deleted?
- how to prevent files and directories from being deleted?
- how to prevent files and directories from being deleted?