Use it when a service cannot create its PID file or socket, or to find runtime sockets.
/run
/run is a tmpfs for runtime data since boot: PID files, sockets, lock files and systemd state. It is cleared at every boot.
1. ls -ld /run and findmnt /run — present and mounted where expected?
2. df -h /run — space left? df -i /run — inodes left?
3. Find large or unexpected content: du -xh --max-depth=1 /run | sort -h | tail.
4. Permissions and owner as the FHS and services expect?
5. Fix space, permissions or mount, then retest the service.
/run mounted (or virtual) → correct owner and permissions → enough space → services read and write as intended
For Filesystem → /run, continue with the first unproven Topic check: Confirm /run mount type/capacity and current boot/session context. If that boundary is healthy, advance to the adjacent check: Map PID files to process start identity and sockets to actual listeners. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
findmnt /runVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
boot/service activation → runtime directory creation → PID/socket/lock object → live process/listener identity → client operation → service result
Healthy evidence: runtime objects are owned by the expected service, map to live process/socket identities and the client operation succeeds during the same boot.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Confirm /run mount type/capacity and current boot/session context.
- Map PID files to process start identity and sockets to actual listeners.
- Check ownership/permissions and service runtime-directory creation semantics.
- Verify service request/response after cleaning or recreating runtime state.
Verification chain. boot/service activation → runtime directory creation → PID/socket/lock object → live process/listener identity → client operation → service result
Step 3 Verification path Verify boundary
Verification is insufficient when it shows only command success, file presence, active/running service, mount existence, route presence or a single localhost test.
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: stale PID interpretation, socket presence treated as readiness, or runtime files are expected to survive reboot.
/run object presence shows runtime namespace state only, but it does not show live process identity, listener readiness or persistence.
Step 5 Common mistakes Narrow the fault
- Putting persistent data in
/run(tmpfs, cleared on boot).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Anything written there disappears at reboot — services create their directories with RuntimeDirectory= in systemd or tmpfiles.d. /var/run is a symlink to /run.
ls -ld <path>— owner, permissions and typestat <path>— inode, links, size and timestampsdf -h <path>— filesystem and free spacefindmnt <path>— which mount the path is on
ReferenceWhat it is1 section · depth on demand
Core model
Treat /run contents as process/service-generated state tied to the current boot. Verify creator ownership, socket/PID-file correspondence and namespace visibility, then correlate to the actual live process. Never infer persistence or healthy service state from a leftover-looking filename alone.
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
/run object presence shows runtime namespace state only, but it does not show live process identity, listener readiness or persistence.
In depth
/run: runtime state since boot
The hier(7) manual page describes /run as information that describes the system since it was booted. It's a tmpfs in memory, empty at every boot. It holds PID files, sockets, lock files and other runtime state. /var/run and /var/lock are usually symlinks to it.
Because it's emptied at boot, anything needed there must be created again. The tmpfiles.d(5) manual page describes systemd-tmpfiles, which creates such entries at boot and cleans them by age. For a service's own runtime directory, it recommends unit settings such as RuntimeDirectory= instead.
Typical contents
| Path | Purpose |
|---|---|
/run/<service>.pid | PID files |
/run/<service>/ | Sockets and state of a service |
/run/systemd/ | systemd's own runtime data |
/run/user/<uid>/ | Per-user runtime directory ($XDG_RUNTIME_DIR) |
/run/lock/ | Lock files |
/run/systemd/resolve/resolv.conf | Resolver configuration generated by systemd-resolved |
Creating runtime directories
| Approach | Configuration |
|---|---|
| In the service unit (preferred) | RuntimeDirectory=reportapi, RuntimeDirectoryMode=0750 |
| A tmpfiles.d entry | d /run/reportapi 0750 reportapi reportapi - |
| In the program itself | Possible only if it runs as root or the parent is writable |
With RuntimeDirectory=, systemd creates /run/reportapi owned by the service user when the service starts, and removes it when it stops.
host$ findmnt /run
TARGET SOURCE FSTYPE OPTIONS
/run tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=1631708k,mode=755
host$ ls /run | head -8
host$ echo $XDG_RUNTIME_DIR
/run/user/1003
host$ sudo systemctl edit report-api
[Service]
RuntimeDirectory=reportapi
RuntimeDirectoryMode=0750
host$ echo 'd /run/legacy-app 0755 legacy legacy -' | sudo tee /etc/tmpfiles.d/legacy-app.conf
host$ sudo systemd-tmpfiles --create /etc/tmpfiles.d/legacy-app.conf
host$ ls -ld /run/legacy-app
A classic after-reboot failure
A service that works until the first reboot, and then fails with "No such file or directory" for /run/<name>, probably had its directory created by hand. Declare it with RuntimeDirectory= or a tmpfiles.d line, so it exists after every boot.
Documented example, not captured output.
Known-good, transitional and broken reference
/run — comparative operational reference for Filesystem → /run. What it does not show: systemd active/running or host-global state alone does not show the workload context is healthy Next check: move one step toward the original workload using Inspect the path and mount in the process namespace, effective UID/GID/ACL/LSM decision, filesystem/inode state and backend errors, then repeat the original file operation. Platform/scope: Linux filesystem/LSM semantics vary by kernel, filesystem, distribution and mount options.
How it works at runtime
/run is part of Filesystem → /run. /run is early-boot volatile runtime state, commonly a tmpfs, used for PID files, sockets, locks, service state and other data that should not survive reboot; many systems map legacy /var/run to /run.
Pseudo-filesystems such as /proc, /sys and many entries under /run expose generated runtime state rather than ordinary persistent files.
Topic-specific state model. /run is early-boot volatile runtime state, commonly a tmpfs, used for PID files, sockets, locks, service state and other data that should not survive reboot; many systems map legacy /var/run to /run.
Interpretation rule. - File in /run ≠ persistent state across reboot.
- PID file exists ≠ referenced PID belongs to the intended live process.
- Socket path exists ≠ listener/service is accepting requests.
- /var/run may be a symlink to /run; treating them as independent stores can misdiagnose state.
Quick reference
/run is a tmpfs created at boot for runtime data: PID files, Unix sockets (/run/docker.sock, /run/php-fpm/www.sock), systemd state, user runtime dirs (/run/user/<uid>). Contents disappear on reboot.
findmnt /run
ls /run/systemd/units | head
# systemd unit option creating /run/myapp owned by the service user
RuntimeDirectory=myapp
RuntimeDirectoryMode=0750
/var/run is a symlink to /run on modern systems.
Limits and how it fails
Primary failure point. /run object presence shows runtime namespace state only, but it does not show live process identity, listener readiness or persistence.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. /run owns volatile runtime-file placement. systemd/services, Processes and IPC/socket branches own object lifecycle and service readiness.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Filesystem → /run. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
/run operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for /run.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | /run is early-boot volatile runtime state, commonly a tmpfs, used for PID files, sockets, locks, service state and other data that should not survive reboot; many systems map legacy /var/run to /run. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin process/container mount namespace → resolve the exact path from / and record every mount crossing → identify final dentry + filesystem/device + inode + file type → capture ownership/mode/ACL and capacity where relevant → map pseudo/device/runtime objects to the live kernel/process endpoint → verify the original consumer read/write/execute/service result. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | boot/service activation → runtime directory creation → PID/socket/lock object → live process/listener identity → client operation → service result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | /run object presence proves runtime namespace state only; it does not prove live process identity, listener readiness or persistence. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated namespace, path and object evidence can establish this Linux Filesystem proof path: boot/service activation → runtime directory creation → PID/socket/lock object → live process/listener identity → client operation → service result | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured namespace, mount, inode/object, authorization, backing-resource or consumer scope. /run object presence proves runtime namespace state only; it does not prove live process identity, listener readiness or persistence. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: preserve the same process mount namespace, resolve the path and mount crossings, identify the exact object/inode or live pseudo/device endpoint, inspect effective access/capacity, then repeat the original consumer operation before changing unrelated filesystem state. | Continue to the next unresolved boundary while preserving the original test condition. |
/run · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | /run |
|---|---|
| Topic path | Filesystem → /run |
| Runtime state | /run is early-boot volatile runtime state, commonly a tmpfs, used for PID files, sockets, locks, service state and other data that should not survive reboot; many systems map legacy /var/run to /run. |
| Fast checks | - Confirm /run mount type/capacity and current boot/session context. - Map PID files to process start identity and sockets to actual listeners. - Check ownership/permissions and service runtime-directory creation semantics. - Verify service request/response after cleaning or recreating runtime state. |
| Verification chain | boot/service activation → runtime directory creation → PID/socket/lock object → live process/listener identity → client operation → service result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | /run object presence proves runtime namespace state only; it does not prove live process identity, listener readiness or persistence. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
Deep reference
Healthy vs suspicious evidence
Commands
ls /run
findmnt /run