Skip to content

Instantly share code, notes, and snippets.

@cerebrate
Created October 29, 2022 21:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cerebrate/7e9932bf82e85e8ccad9ed2c35c5bfb8 to your computer and use it in GitHub Desktop.
Save cerebrate/7e9932bf82e85e8ccad9ed2c35c5bfb8 to your computer and use it in GitHub Desktop.
Fix for /dev/shm being mounted at /run/shm under WSL.
[Unit]
Description=Fix the /dev/shm symlink to be a mount
DefaultDependencies=no
Before=sysinit.target
ConditionPathExists=/dev/shm
ConditionPathIsSymbolicLink=/dev/shm
ConditionPathIsMountPoint=/run/shm
[Service]
Type=oneshot
ExecStart=/usr/bin/rm /dev/shm
ExecStart=/usr/bin/mkdir /dev/shm
ExecStart=/bin/umount /run/shm
ExecStart=/usr/bin/rmdir /run/shm
ExecStart=/bin/mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime tmpfs /dev/shm
ExecStart=/usr/bin/ln -s /dev/shm /run/shm
[Install]
WantedBy=sysinit.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment