[opensuse] /var/run
Hello, OpenSuSe 13.1 I want to create a directory in /var/run - say, /var/run/sm-client/. After a reboot, this directory is no longer there. What thingy is removing it and how may I have control over my own machine again? Thanks! -- Mike G. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, Dec 27, 2013 at 5:57 PM, Mike Grau <m.grau@kcc.state.ks.us> wrote:
Hello,
OpenSuSe 13.1
I want to create a directory in /var/run - say, /var/run/sm-client/.
After a reboot, this directory is no longer there. What thingy is removing it and how may I have control over my own machine again?
Thanks! -- Mike G.
You should not be expecting anything in /run or /var/run to survive a reboot. Here's a LWN article about it: http://lwn.net/Articles/436012/ Anyway in 13.1, /var/run is "tmpfs". Meaning there is no disk space backing it up. Thus on reboot, it gets recreated in it's virgin state every time. As to how to change that, I'm not sure you can easily. If you data that needs to survive reboots, can't you just move it somewhere that is not a tmpfs? Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Greg Freemyer said the following on 12/27/2013 06:17 PM:
You should not be expecting anything in /run or /var/run to survive a reboot. Here's a LWN article about it:
An interesting article but I don't think it helps the OP.
Anyway in 13.1, /var/run is "tmpfs". Meaning there is no disk space backing it up. Thus on reboot, it gets recreated in it's virgin state every time.
Yes it gets recreated on boot and actually it does have disk space backing it up. This is an 'in memory' file system and like everything else 'in memory' it can, if needed, be paged out. Thus there *is* disk space backing it up: swap space.
As to how to change that, I'm not sure you can easily.
Yes you can, quite easily See TMPFILES.D(5)
If you data that needs to survive reboots, can't you just move it somewhere that is not a tmpfs?
That's a very good point. Any TMP might be volatile or get purged. Even files in systems where /tmp is a on-disk file system can get purged by routines stated by cron. -- How long did the whining go on when KDE2 went on KDE3? The only universal constant is change. If a species can not adapt it goes extinct. That's the law of the universe, adapt or die. -- Billie Walsh, May 18 2013 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Mike Grau said the following on 12/27/2013 05:57 PM:
Hello,
OpenSuSe 13.1
I want to create a directory in /var/run - say, /var/run/sm-client/.
After a reboot, this directory is no longer there. What thingy is removing it and how may I have control over my own machine again?
You always have had control over your machine. If you run the 'mount' command you will see a line tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755) which tells you that this is a dynamically generated file system. Use of 'apropos' and perhaps google will lead you to the relevant config file directory, and the contents there of are documented ... TMPFILES.D(5) As I said, you always did have control over your machine. I have this in 12.3 and IIR it was in previous releases as well. In defiance of the RoR adage, Linux is built around configuration files. Much more so than UNIX ever was. Perhaps we need an acronym similar to "RTFM" to mean that its controlled by a config file. -- How long did the whining go on when KDE2 went on KDE3? The only universal constant is change. If a species can not adapt it goes extinct. That's the law of the universe, adapt or die. -- Billie Walsh, May 18 2013 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
El 27/12/13 19:57, Mike Grau escribió:
Hello,
OpenSuSe 13.1
I want to create a directory in /var/run - say, /var/run/sm-client/.
man tmpfiles.d
After a reboot, this directory is no longer there.
As expected. yes. What thingy is
removing it and how may I have control over my own machine again?
Nothing is usually removing files at boot, this legacy directory is nowadays a bind mount to /run, storage is backed by shared memory and is therefore lost on reboot. This is done to ensure applications do not encounter files left in place on unclean shutdown or due to a bug. Be suspicious about things that want to use this directory. I have looked at quite a bit of stuff and can safely tell you that unfortunately bugs are the norm not the exception, applications generally have quite nasty race conditions when attempting to create locks or pidfiles there. (see daemon(7) the "15 steps of death" most apps fail at step 12 ) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Nothing is usually removing files at boot, this legacy directory is nowadays a bind mount to /run, storage is backed by shared memory and is therefore lost on reboot. This is done to ensure applications do not encounter files left in place on unclean shutdown or due to a bug.
Thank you all for educating me; I had forgotten that /var/run was now a tmpfs. I'll use another location. -- Mike -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Anton Aylward
-
Cristian Rodríguez
-
Greg Freemyer
-
Mike Grau