Ubuntu Pastebin

Paste from didrocks at Wed, 4 Mar 2015 07:08:05 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[Unit]
Description=Mount /tmp as tmpfs if nearly full
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=tmp.mount
ConditionPathIsSymbolicLink=!/tmp
ConditionPathIsReadWrite=/tmp

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -ec "[ `df -BM -P /tmp/ | awk 'NR==2 { print substr($4, 0, length($4)-1) }'` -lt 50 ] && mount -t tmpfs -o mode=1777 overflow /tmp"

[Install]
WantedBy=local-fs.target
Download as text