Carlos E. R. wrote:
On 2017-04-14 22:11, Dave Howorth wrote:
On Fri, 14 Apr 2017 19:45:28 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
Do we have a method so that halt, reboot, suspend, hibernate operations are disabled? Requiring a secondary confirmation or removal of the inhibit?
Ah, yes. That could work, at least for halt or reboot. I will do it, thanks.
But not for "systemctl hibernate"
--- Neither for "kill -9 1". That's why only 'root' can 'normally' do those things (w/the idea that they'd be responsible)... But in regards to having "training wheels" on commands, please don't encourage the Gnannies -- they only dumb down utils and remove functionality. There are many examples, but due to gnu slavishly following the posix nannies (who took orders from the BSD folks "protecting the children"), "rm" can no longer be used to safely remove all of a directory's contents (w/o removing the directory). It used to be you could use "rm --one-file-system -fr ." or "rm -fr --one-file-system "DIRNAME/." to remove everything under (or in) the directory you were in or in "DIRNAME" (respectively). Now, you need to use 'find' to do something along the lines of: 'find . -xdev -depth |xargs rm -fr' :-( ! (find has a "-delete" option, but I don't know that it's "posix" approved). For a tree like: Ishtar:/tmp/foo1> tree . . ├── a ├── b ├── d ├── mnt │ └── file └── mnt_file 2 directories, 4 files one might think to use "rm *" (indeed some have suggested this). 12345678901234567890123456789012345678901234567890123456789012345678901234567890 But turning on hidden files, inode & devices: Ishtar:/tmp/foo1> tree -a --inodes --device . . ├── [8550811 2082] .c │ ├── [ 5126 2082] .a │ └── [8550812 2082] b ├── [17400567 2082] .e ├── [17319254 2082] a ├── [17400566 2082] b ├── [17400568 2082] d ├── [23013870 42] mnt │ └── [23014625 42] file └── [23014625 42] mnt_file 5 directories, 5 files ------------- - Note: "hidden members": .c, .c/.a .c/b and .e and note: mnt_file, mnt/, & mnt/file are on a separate device from the root of the dir... So this is needed for safety now:
find . -xdev -depth -delete
vs. rm (an uncastrated version)
rm -frx .
Which leaves: Ishtar:/tmp/foo1> tree -x --inodes --device . . ├── [23013870 42] mnt └── [23014625 42] mnt_file 1 directory, 1 file I used to use things like: cd /mnt/foo1 && rm -fr . to be extra safe about my deleting everything under a directory (where I knew there were no mounted file sysytems). Little chance of mistyping and deleting something I didn't want deleted -- no slashes in my "rm" with it protected/dependent on the 'cd'. Also nanny work: defaulting "ls" to quoting filenames. Work to remove use of ENV vars and disallow setting default behaviors for your local commands (like having grep skip binary files or devices) is under way. :-? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org