Re: how to prevent files and directories from being deleted?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 10/04/2017 01:23 AM, Gary Stainburn wrote:
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.


The simplest solution that comes to mind at 7:30am is simply bind mounting a directory that's persistent.  You'll still need to define that directory using tmpfiles.d, but...

   echo "D /var/run/mariadb 0755 root root -" >
   /etc/tmpfiles.d/mariadb.conf
   mkdir /var/run-persistent/mariadb -p
   echo "/var/run-persistent/mariadb /var/run/mariadb none bind 0 0" >>
   /etc/fstab

Obviously, test this somewhere before you do it to a system you care about.  It's early, and I haven't.  I'm not sure startup ordering will be correct for this sort of thing...

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux