hw
2017-Oct-01 15:21 UTC
[CentOS] how to prevent files and directories from being deleted?
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. -- "Didn't work" is an error.
Alexander Dalloz
2017-Oct-01 15:26 UTC
[CentOS] how to prevent files and directories from being deleted?
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. Curious, how did you install MariaDB that you have such a problem? The package shipping with CentOS does not create such issue. Alexander
marcos valentine
2017-Oct-02 12:36 UTC
[CentOS] how to prevent files and directories from being deleted?
You can try chattr? https://en.wikipedia.org/wiki/Chattr 2017-10-01 12:26 GMT-03:00 Alexander Dalloz <ad+lists at uni-x.org>:> 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-tempo > rary-files-with-systemd-tmpfiles-on-rhel7/ > > how to manage tmpfiles. > > Curious, how did you install MariaDB that you have such a problem? The > package shipping with CentOS does not create such issue. > > Alexander > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
Mark Haney
2017-Oct-02 13:17 UTC
[CentOS] how to prevent files and directories from being deleted?
On 10/01/2017 11:21 AM, hw wrote:> 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. > >What did you put in there that causes such issues in the first place?? There shouldn't be a thing in that directory except the PID of the running process. It stands to reason that would be emptied on restart since the service would be shutdown cleanly (usually) before rebooting. If you've got stuff in there that a) you need to keep across reboots and/or b) data that requires root access, you're simply not doing it right.? Might I suggest reading up on how CentOS/RHEL's directory structure and what should go where?? It seems to me you're trying to put a square peg in a round hole and getting frustrated because it won't fit. -- Mark Haney Network Engineer at NeoNova 919-460-3330 option 1 mark.haney at neonova.net www.neonova.net
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.
Harold Toms
2017-Oct-04 15:08 UTC
[CentOS] how to prevent files and directories from being deleted?
On 01/10/17 16:21, hw wrote:> 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. > >Assuming that your /usr/lib/tmpfiles.d/mariadb.conf file contains: d /var/run/mariadb 0755 mysql mysql - the /var/run/mariadb should be recreated on every reboot... if it is not, perhaps either the mysql user or group do not exist. Check /etc/passwd and /etc/group. -- regards H
hw
2017-Oct-09 12:47 UTC
[CentOS] how to prevent files and directories from being deleted?
Harold Toms <h.toms at qmul.ac.uk> writes:> On 01/10/17 16:21, hw wrote: >> 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. >> >> > Assuming that your /usr/lib/tmpfiles.d/mariadb.conf file contains: > > d /var/run/mariadb 0755 mysql mysql -Thanks! There is no such file. Apparently we are not supposed to create such files, and now I must compile mariadb from source because otherwise I wouldn?t be following best practises an be out of my right mind ... ;) Somehow, I doubt I would have a file like that if I did that. I might even get stuck in a compiling loop, following best practises indefinitely ...> the /var/run/mariadb should be recreated on every reboot... if it is > not, perhaps either the mysql user or group do not exist. Check > /etc/passwd and /etc/group.They do exist. The server isn?t in production yet, so I can create the file and see what happens when rebooting it. Let?s hope that it doesn?t vanish when I do that ... -- "Didn't work" is an error.
I've just noticed the i386 Centos 7.4 updates have appeared, including bringing it to kernel 3.10.0-693.2.2. I suspect that a great deal of work had to go in to achieving this. May I say a big "Thank-You" to everyone who has made this possible! -- regards Harold Toms
Reasonably Related 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?