Eeek! I ran this script on a Centos5 box to secure tmp. Shortly after that, the box went down. I didnt even reboot it, it just died on me. I hope it wanst a result of what happened here. I hope it comes back up after the reboot. Didnt even have a chance to look at fstab yet.
/usr/local/bin/els: line 1554: [: =: unary operator expected
ELS can secure your /tmp, /var/tmp, and /dev/shm partitions.
Proceed? (y/n): y
No /tmp partition in /etc/fstab.
No /tmp partition mounted.
Backing up current fstab...
Successfully backed up as '/usr/local/els/bakfiles/fstab.bak'!
Making extended filesystem for /tmp... (this may take a few moments)
524288+0 records in
524288+0 records out
536870912 bytes (537 MB) copied, 18.1044 seconds, 29.7 MB/s
Please press "y" when prompted...
mke2fs 1.39 (29-May-2006)
/var/tmpFS is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
64 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Stopping MySQL: [ OK ]
mv: cannot stat `/tmp/*': No such file or directory
mv: cannot move `/tmp/.' to `/tmp_backup/.': Device or resource busy
mv: cannot remove `/tmp/..': Is a directory
Mounting /tmp...
mv: cannot stat `/tmp_backup/*': No such file or directory
mv: inter-device move failed: `/tmp_backup/.' to `/tmp/.'; unable to remove target: Is a directory
mv: cannot remove `/tmp_backup/..': Is a directory
Done.
Starting MySQL: [ OK ]
Done. /tmp has been secured.
Found /var/tmp partition in /etc/fstab.
/etc/fstab already backed up as /usr/local/els/bakfiles/fstab.bak
Modifying /etc/fstab...
Done.
Remounting /var/tmp...
[mntent]: line 8 in /etc/fstab is bad
mount: can't find /var/tmp in /etc/fstab or /etc/mtab
Done.
You should check '/etc/fstab' before you reboot your system!!!
Found /dev/shm partition in /etc/fstab.
Backing up current configuration file...
/etc/fstab already backed up as /usr/local/els/bakfiles/fstab.bak
Modifying /etc/fstab...
Done.
Remounting /dev/shm...
[mntent]: line 2 in /etc/fstab is bad
[mntent]: line 4 in /etc/fstab is bad
[mntent]: line 5 in /etc/fstab is bad
[mntent]: line 6 in /etc/fstab is bad
[mntent]: line 7 in /etc/fstab is bad; rest of file ignored
mount: can't find /dev/shm in /etc/fstab or /etc/mtab
Done.
You should check '/etc/fstab' before you reboot your system!!!
This is what fstab looked like before
Code:
/dev/md0 / ext3 grpquota,usrquota,rw 0 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hdc1 swap swap defaults 0 0
This is what it look like now
Code:
/dev/md0 / ext3 grpquota,usrquota,rw 0 1
LABEL=/boot /boot ext3 tmpfs
/dev/shm tmpfs rw,noexec,nosuid,nodev 0 0 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs tmpfs
/dev/shm tmpfs rw,noexec,nosuid,nodev 0 0 0 0
proc /proc proc tmpfs
/dev/shm tmpfs rw,noexec,nosuid,nodev 0 0 0 0
sysfs /sys sysfs tmpfs
/dev/shm tmpfs rw,noexec,nosuid,nodev 0 0 0 0
LABEL=SWAP-hdc1 swap swap tmpfs
/dev/shm tmpfs rw,noexec,nosuid,nodev 0 0 0 0
/var/tmpFS /tmp ext3 /var/tmpFS /tmp ext3 rw,noexec,nosuid,nodev,bind 0 0 0 0