$ if [ false ]; then echo "That was a true statement"; fi
Compare cert salaries and plan your next career move
LinuxInAlaska wrote: » I agree with Marco71 on why it is a bad idea and what can go wrong. I would take a different route to perform the delete and just dorm -rf TrashCan/* If you fat finger the name TrashCan, it would simply come back with a "No such file or directory" error.
rm -rf TrashCan/*
onesaint wrote: » Forgot to reply! You're talking about the OOM killer I suspect. Had to look this one up and found a great article on this from Oracle here.
[root@linux ~]# ls -lZ asdf.txt -rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 asdf.txt [root@linux ~]# getfacl asdf.txt # file: asdf.txt # owner: root # group: root user::rw- group::r-- other::r-- [root@linux ~]# rm -fv asdf.txt rm: cannot remove `asdf.txt': Operation not permitted [root@linux ~]# echo asdf > asdf.txt bash: asdf.txt: Permission denied
Expect wrote: » chattr -/+ i ?
UnixGuy wrote: » Interesting, so how often do you see chattr used in production? How useful is it? Have you seen in production? what was it used for?
MentholMoose wrote: » What command will let you view the current iptables rules? (generally distribution-agnostic) What is the default command-line "helper" application to create iptables rules on recent Fedora versions (and likely RHEL 7)? On recent Ubuntu versions? BONUS: Write an example command for both to open port 443/tcp.
W Stewart wrote: » 1. iptables-save
W Stewart wrote: » That's it. I did have to look it up as well but I figured there had to be a sysctl setting to alter the way the system behaved when it ran out of memory but I was already aware of being able to set the reboot time on a kernel panic. I went on a week long vacation but I still check the shift reports and it doesn't look like anybody has ad to manually reboot the box yet.
#!/bin/bash # This variable is the amount of free memory that you want to trigger the HUP at threshold=50000 # This variable is the name of your process(es) you want to HUP process="java" # this variable is the free memory on the system as determined by vmstat memfree=$(vmstat -s | grep "free memory" | awk {'print $1'}) # Logic loop if [[ $memfree -lte $threshold ]]; then sudo pkill -HUP $process #leave off sudo if running out of root's crontab fi
W Stewart wrote: » Which question is that an answer to? Edit: you would need to run lsattr to see if the +i flag was set with the chattr command.
Expect wrote: » it's a terminal user interface for managing iptables, basically a simple "gui" from the CLI, if that was your question(?)
ls /usr/bin/system-config-firewall{,-tui}
The Technomancer wrote: » A more elegant way of managing this, especially when the memory leak is a non-resolvable issue without a new software release, is to monitor the RAM usage by the application in question (either with a cronjob or an external monitoring source like Nagios) and throw a SIGHUP at the process if it crosses that threshold. Zero downtime, no 5 minute+ long reboot, etc. Example script for that to be run as a cronjob checking every minute...which assumes that the process mentioned here is the only one that would be causing the system to go OOM, and for example purposes, is the lone java app on a server:#!/bin/bash # This variable is the amount of free memory that you want to trigger the HUP at threshold=50000 # This variable is the name of your process(es) you want to HUP process="java" # this variable is the free memory on the system as determined by vmstat memfree=$(vmstat -s | grep "free memory" | awk {'print $1'}) # Logic loop if [[ $memfree -lte $threshold ]]; then sudo pkill -HUP $process #leave off sudo if running out of root's crontab fi Run that every minute out of your system user's (or roots, leave off sudo) crontab. Add a notification to the if loop if you want to track how often this occurs.
Compare salaries for top cybersecurity certifications. Free download for TechExams community.