SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Using vim I edited the script using this new line of instruction, and everything is working again, just as it did with the previous line of instruction, as it should.
I am not sure, but I do not think this could have happened updating the system using slackpkg?
So two main questions:
(1). How did/could this of happened?
And;
(2). What is the difference between these three lines of instruction:
I can't say what's happening, but I would be curious what an inotifywatch on the file would turn up.
Code:
# inotifywatch -v -e modify /etc/rc.d/rc.local
If you did a full install, the inotify-tools package will be available. There are other interesting and useful options. You could leave out the -e modify and it would watch for all events listed in the manpage. Or, you could have multiple events to watch for:
If you are missing inotify-tools, it is easy to install it using slackpkg, the installation media, or even downloading from official slackware mirror then installing with installpkg. If you need help with any of these, having read the man pages and installation help, don't hesitate to ask.
Wow thanks J_V for the fast reply and easy explanation!
I still can't see why it would change from a "1" to a "2"??? From the efforts of your second post (thanks by the way),
the "-minddepth 2" option would clean out sub-directories of the directories in the /tmp directory, with the command line arguments held in this:
As far as the second question, the main difference is the -mindepth options. The second and third lines of the second question are (to the best of my understanding of find and xargs) simply two forms to achieve the same thing; I've seen various security issues mentioned for using both the -exec find option as well as piping the output of find to xargs to do processing on files found. The find man page explains about the security risks involved in using 'find ... -exec' and about using the -execdir option instead. See the find info page, in the 'Security Considerations' node, for more thorough handling of the subject.
That way, /tmp is cleaned out by a reboot automatically. If there are temporary files that should survive reboot, you put them in /var/tmp
(This doesn't solve your problem with the rc.local_shutdown script and how it somehow mutated; it just shows another way to have /tmp cleaned out at reboot.)
I can't see that it will rm any files at all, seeing you use 'O' (letter oh) as an argument to xargs rather than '0' (digit zero), irrespective of of mindepth being 1 or 2
Occam's Razor: the simplest explanation is usually the right one.
My gut feeling is that you changed it somehow maybe using a malformed sed command or maybe you just never entered the script the way you said you did, and you just think you did.
I can't see that it will rm any files at all, seeing you use 'O' (letter oh) as an argument to xargs rather than '0' (digit zero), irrespective of of mindepth being 1 or 2
Apart from that above, if you use vim to edit these files there's a common mistake I make in vim from time to time: when being near a number, the combination Ctrl+A increases that number. I usually make that mistake if I think I'm inside a screen session when using vim, and I'm not.
Apart from that above, if you use vim to edit these files there's a common mistake I make in vim from time to time: when being near a number, the combination Ctrl+A increases that number. I usually make that mistake if I think I'm inside a screen session when using vim, and I'm not.
Thanks for bringing up the Ctrl-A vim function. As just a basic and fumble fingered vim user this is good for me to know and watch out for.
I can relate to your situation. For me, it's when I use a GUI editor I end up with :w, dd and such peppered throughout the document.
I can't see that it will rm any files at all, seeing you use 'O' (letter oh) as an argument to xargs rather than '0' (digit zero), irrespective of of mindepth being 1 or 2
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.