[opensuse] clean tmp directories automatically fails.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm still using 12.1, systemv mode. In /etc/sysconfig/cron I have: MAX_DAYS_IN_TMP=30 ## Type: string ## Default: "/tmp" # # This variable contains a list of directories, in which old files are to # be searched and deleted. # TMP_DIRS_TO_CLEAR="/tmp" But I have dirs and files years old in /tmp, so the cron job, although it runs, does not delete them: Telcontar:/etc/cron.daily # ls -ltr /tmp | grep cer | head drwx------ 2 cer users 299008 Jan 1 1970 orbit-cer drwx------ 2 cer users 4096 Jan 9 2008 keyring-XX4s2Z drwx------ 2 cer users 4096 Jan 21 2008 keyring-fcAf7E drwx------ 2 cer users 4096 Mar 9 2008 keyring-Lh5r6P drwx------ 2 cer2 users 4096 Mar 19 2008 ksocket-cer2 drwx------ 2 cer users 4096 Apr 8 2008 orbit-kar drwx------ 2 cer users 4096 Apr 16 2008 keyring-jYD6si drwx------ 2 cer2 users 4096 Apr 20 2008 orbit-cer2 drwx------ 2 cer users 4096 May 11 2008 lyx_tmpdir16393UwWD88 drwx------ 2 cer users 4096 Jun 5 2008 keyring-yxm4IE and files: srwxr-xr-x 1 cer users 0 Jan 31 2010 filezYgwBN srwxr-xr-x 1 cer users 0 Jan 31 2010 filewinvfe srwxr-xr-x 1 cer users 0 Jan 31 2010 filesCxmxt srwxr-xr-x 1 cer users 0 Jan 31 2010 filer3H8ht srwxr-xr-x 1 cer users 0 Jan 31 2010 filemqVuOU srwxr-xr-x 1 cer users 0 Jan 31 2010 filem0eB48 srwxr-xr-x 1 cer users 0 Jan 31 2010 filelWOSzD srwxr-xr-x 1 cer users 0 Jan 31 2010 filelCW6hr srwxr-xr-x 1 cer users 0 Jan 31 2010 fileibpXPW srwxr-xr-x 1 cer users 0 Jan 31 2010 filehGUJgY I have edited the shebang of "/etc/cron.daily/suse.de-clean-tmp" to "#!/bin/sh -x". This is a manual run: Telcontar:/etc/cron.daily # ./suse.de-clean-tmp + umask 022 + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + '[' -f /etc/sysconfig/cron ']' + . /etc/sysconfig/cron ++ REINIT_MANDB=yes ++ DELETE_OLD_CATMAN=yes ++ CATMAN_ATIME=7 ++ MAX_DAYS_IN_TMP=30 ++ TMP_DIRS_TO_CLEAR=/tmp ++ OWNER_TO_KEEP_IN_TMP=root ++ CLEAR_TMP_DIRS_AT_BOOTUP=no ++ DELETE_OLD_CORE=no ++ MAX_DAYS_FOR_CORE=7 ++ MAX_DAYS_IN_LONG_TMP=90 ++ LONG_TMP_DIRS_TO_CLEAR=/var/tmp ++ DAILY_TIME=22:10 ++ MAX_NOT_RUN=2 ++ SEND_MAIL_ON_NO_ERROR=no ++ SYSLOG_ON_NO_ERROR=yes ++ SEND_OUTPUT_ON_NO_ERROR=no + OMIT= + for i in '$OWNER_TO_KEEP_IN_TMP' + OMIT=' ( ! -user root )' + cleanup_tmp 30 /tmp + MAX_DAYS=30 + shift + DIRS_TO_CLEAR=/tmp + '[' 30 -gt 0 ']' + for DIR in '$DIRS_TO_CLEAR' + test -x /usr/bin/safe-rm + find /tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rm '{}' ';' + find /tmp/. -xdev -depth -mindepth 1 '(' '!' -user root ')' -type d -empty '(' -mtime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rmdir '{}' ';' + cleanup_tmp 90 /var/tmp + MAX_DAYS=90 + shift + DIRS_TO_CLEAR=/var/tmp + '[' 90 -gt 0 ']' + for DIR in '$DIRS_TO_CLEAR' + test -x /usr/bin/safe-rm + find /var/tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +90 -a -ctime +90 ')' -exec /usr/bin/safe-rm '{}' ';' + find /var/tmp/. -xdev -depth -mindepth 1 '(' '!' -user root ')' -type d -empty '(' -mtime +90 -a -ctime +90 ')' -exec /usr/bin/safe-rmdir '{}' ';' + exit 0 Telcontar:/etc/cron.daily # What is wrong? Spacewise it is not important, just 70 megs used. If I run one of the 'find' lines above, I get nothing: Telcontar:~ # find /tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +30 -a -ctime +30 ')' -exec ls -l '{}' ';' Telcontar:~ # Why does it not find old files and directories? drwx------ 2 cer users 4096 Jun 14 2008 keyring-V8GYZ8 drwx------ 2 cer users 4096 Jul 15 2008 keyring-r8mxT6 drwx------ 2 cer users 4096 Sep 10 2008 seahorse-GpPwGj drwx------ 2 cer users 4096 Sep 10 2008 seahorse-n2eVJ8 - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF5trcACgkQtTMYHG2NR9VG8wCgkm9gp89iFPRBdU2nYCV8WfZP fgYAn3n0uEBkM53bLhduKjDV+fVu281p =tSHo -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. said the following on 04/25/2013 07:05 PM:
[snip]
But I have dirs and files years old in /tmp, so the cron job, although it runs, does not delete them:
Telcontar:/etc/cron.daily # ls -ltr /tmp | grep cer | head drwx------ 2 cer users 299008 Jan 1 1970 orbit-cer [snip]
Those are directories
and files:
srwxr-xr-x 1 cer users 0 Jan 31 2010 filezYgwBN [snip]
Those are not files, those are sockets.
I have edited the shebang of "/etc/cron.daily/suse.de-clean-tmp" to "#!/bin/sh -x". This is a manual run:
[snip]
+ find /tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rm '{}' ';'
Help me here. It looks to me as if the '!' -type d means that it ignores directories and that the '!' -type s means to ignore sockets. So the stuff you have listed above is ignored
If I run one of the 'find' lines above, I get nothing:
Yes, that sounds right.
Why does it not find old files and directories?
Because its been configured to ignore directories and those other things are sockets not files. Well OK, this is *NIX so "everything is a file", except network connections. cf Plan 9. The issue of whether or not empty directories and sockets can be removed is a thorny one. With a machine that isn't being rebooted every day, a server rather than a workstation, its quite reasonable to assume that its going to have services that are active for more than 30 days :-) There may be good reasons for long lived sockets. You can make a good case that these should be under /run rather than /tmp and I'd agree, but we have a lot of legacy code and there's no-one enforcing standards, threatening programmers with unemployment (or worse - writing documentation!) if they don't conform. -- Engineers aren't boring people; we just get excited over boring things. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2013-04-25 at 19:27 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 07:05 PM:
Telcontar:/etc/cron.daily # ls -ltr /tmp | grep cer | head drwx------ 2 cer users 299008 Jan 1 1970 orbit-cer [snip]
Those are directories
Yes.
and files:
srwxr-xr-x 1 cer users 0 Jan 31 2010 filezYgwBN [snip]
Those are not files, those are sockets.
Ah, you are right... Do I have files? [...] no... so that's it.
I have edited the shebang of "/etc/cron.daily/suse.de-clean-tmp" to "#!/bin/sh -x". This is a manual run:
[snip]
+ find /tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rm '{}' ';'
Help me here. It looks to me as if the '!' -type d means that it ignores directories and that the '!' -type s means to ignore sockets.
I didn't analyze the line that much, I'm afraid. I have never used such complex find searches myself, so those "details" did not jump to my sight.
So the stuff you have listed above is ignored
Right.
Why does it not find old files and directories?
Because its been configured to ignore directories and those other things are sockets not files.
Yes, and those directories I looked into contain sockets.
Well OK, this is *NIX so "everything is a file", except network connections. cf Plan 9.
The issue of whether or not empty directories and sockets can be removed is a thorny one. With a machine that isn't being rebooted every day, a server rather than a workstation, its quite reasonable to assume that its going to have services that are active for more than 30 days :-) There may be good reasons for long lived sockets.
Yes, indeed. So, I have to look in /tmp now and then and clear manually :-) (perhaps sockets could be deleted if so many days older than the uptime of the machine. But then I remember that the uptime wraps around t 0 after I don't remember how many days...)
You can make a good case that these should be under /run rather than /tmp and I'd agree, but we have a lot of legacy code and there's no-one enforcing standards, threatening programmers with unemployment (or worse - writing documentation!) if they don't conform.
Argh, writing docs! That's naughty! Ok, ok... X'-) The problem is not really the script not cleaning up, but programs not cleaning after themselves. Have a look: drwx------ 2 cer users 4096 Mar 4 2009 keyring-EJGokz drwx------ 2 cer users 4096 May 14 2011 keyring-FVzWKv drwx------ 2 cer users 4096 Dec 2 02:36 keyring-GYuuSo drwx------ 2 cer users 4096 Mar 24 2009 keyring-Gi2hKk drwx------ 2 cer users 4096 Dec 23 2010 keyring-IV0iGJ drwx------ 2 cer users 4096 Dec 6 2009 keyring-Ik2Sjx drwx------ 2 cer users 4096 Mar 9 2008 keyring-Lh5r6P drwx------ 2 cer users 4096 Apr 17 16:30 keyring-MJJcSi ... drwx------ 2 cer users 4096 Feb 15 2011 seahorse-0E4zfa drwx------ 2 cer users 4096 Feb 3 2009 seahorse-0OmSoR drwx------ 2 cer users 4096 Jan 23 2009 seahorse-1G4VSv drwx------ 2 cer users 4096 Jul 20 2009 seahorse-1WBSkK drwx------ 2 cer users 4096 Mar 4 2009 seahorse-1e18Lb drwx------ 2 cer users 4096 Mar 19 2009 seahorse-2p8VIV drwx------ 2 cer users 4096 Jan 29 2011 seahorse-3AvwDt drwx------ 2 cer users 4096 Sep 10 2009 seahorse-3OGTDh drwx------ 2 cer users 4096 Dec 8 2010 seahorse-3gKRhV drwx------ 2 cer users 4096 Mar 24 2009 seahorse-42rkcB Those programs are not clearing when they close, and each time they start they create again another temporary folder, or socket, or whatever. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF5zfoACgkQtTMYHG2NR9XoOgCZATrH4EdPMUBltrjy8VmAYZnK x/0An1fVh1oXwTZngYHkQulbqbgQs8Mo =XxKV -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. said the following on 04/25/2013 08:44 PM:
Those are not files, those are sockets. Ah, you are right... Do I have files? [...] no... so that's it.
I would have done a find /tmp -type f .... to see what *FILES* there were.
I didn't analyze the line that much, I'm afraid. I have never used such complex find searches myself, so those "details" did not jump to my sight.
Me too :-) hence the simple thing above ... Try it, see if you have *any* files :-) -- System Integrity Revisited Rebecca T. Mercuri and Peter G. Neumann Inside Risks 127, CACM 44, 1 January 2001 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2013-04-25 at 21:11 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 08:44 PM:
Those are not files, those are sockets. Ah, you are right... Do I have files? [...] no... so that's it.
I would have done a find /tmp -type f .... to see what *FILES* there were.
I didn't analyze the line that much, I'm afraid. I have never used such complex find searches myself, so those "details" did not jump to my sight.
Me too :-) hence the simple thing above ... Try it, see if you have *any* files :-)
Too late :-) I used 'mc', sorted by date, and deleted everything from 2012 and back, except those directories with fixed names like "kde-cer". "find /tmp -type f" finds things, but younger. Telcontar:~ # find /tmp '(' '!' -user root ')' -type f '(' -atime +30 -a -ctime +30 ')' Telcontar:~ # For root, I found a few things, and I just deleted those, right now. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF52w8ACgkQtTMYHG2NR9WXlwCfcNPow+Czi6Q5ZQqaw6YCDgeP HdsAn2g04NztX0Uof49bdq4KgMlL1mke =qpO/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. said the following on 04/25/2013 08:44 PM:
The problem is not really the script not cleaning up, but programs not cleaning after themselves. Have a look:
drwx------ 2 cer users 4096 Mar 4 2009 keyring-EJGokz [snip]
Those programs are not clearing when they close, and each time they start they create again another temporary folder, or socket, or whatever.
Argh! OUCH! Don't get me started... -rw------- 1 anton users 132300 Apr 23 11:38 04129517b8c48 -rw------- 1 anton users 132300 Apr 23 11:38 04129517c66e7 -rw------- 1 anton users 132300 Apr 23 11:38 04129517f8883 -rw------- 1 anton users 132300 Apr 23 11:38 0412951829d7d -rw------- 1 anton users 132300 Apr 23 12:05 042515178a8fd -rw------- 1 anton users 132300 Apr 23 12:05 042515179845d -rw------- 1 anton users 132300 Apr 23 12:05 04251517af54e -rw------- 1 anton users 132300 Apr 23 12:05 042515180e23a drwx------ 1 anton users 0 Apr 17 09:56 acroread_501_100 drwx------ 1 anton users 0 Apr 24 05:58 akonadi-anton.dI5qpD drwxr-xr-x 1 anton users 8 Apr 20 22:07 anton drwxr-xr-x 1 anton users 120 Apr 24 05:59 Cache -rw------- 1 anton users 1 Apr 25 20:51 _CACHE_CLEAN_ -rw------- 1 anton users 146 Apr 25 21:07 enigcmd.txt -rw------- 1 anton users 1948878 Apr 25 21:12 enigdbug.txt -rw------- 1 anton users 347 Apr 25 21:07 enigenv.txt -rw------- 1 anton users 0 Apr 25 21:07 enigerr.txt -rw------- 1 anton users 0 Apr 25 21:07 eniginp.txt -rw------- 1 anton users 922 Apr 25 21:07 enigout.txt drwx------ 1 anton users 22 Apr 24 05:56 gpg-0g1yS6 drwx------ 1 anton users 22 Apr 22 06:52 gpg-4MM3U3 drwx------ 1 anton users 22 Apr 24 05:58 gpg-dSvzGG drwx------ 1 anton users 22 Apr 22 06:54 gpg-LIZoi1 drwxr-xr-x 1 anton users 10 Apr 23 11:39 hsperfdata_anton drwx------ 1 anton users 148 Apr 20 22:07 icedteaplugin-anton drwx------ 1 anton users 22 Apr 24 05:58 kde-anton drwx------ 1 anton users 594 Apr 25 20:58 ksocket-anton -rw------- 1 anton users 4127 Apr 25 07:31 nsmail.eml -rw------- 1 anton users 203 Apr 25 07:31 nsmail.tmp -rw------- 1 anton users 601964 Apr 18 16:51 nsmail.wav drwx------ 1 anton users 0 Apr 22 19:23 plugtmp drwx------ 1 anton users 0 Apr 25 09:28 plugtmp-1 drwx------ 1 anton users 0 Apr 17 07:42 plugtmp-2 drwx------ 1 anton users 0 Apr 20 07:56 plugtmp-3 drwx------ 1 anton users 18 Apr 25 07:19 pulse-k5BXZ67eP4km -rw-r--r-- 1 anton users 331 Apr 20 22:40 siif_index.html drwx------ 1 anton users 20 Apr 22 06:52 ssh-eb84YWCEXZ6y drwx------ 1 anton users 20 Apr 24 05:58 ssh-lV4vpOThi5qL drwx------ 1 anton users 20 Apr 22 06:54 ssh-MAAovVK63n5D drwx------ 1 anton users 20 Apr 24 05:56 ssh-qLUuapS6u5Pe Thunderbird and its gpg plugin drop junk; ssh uses /tmp instead of /run; thunderbird's calendar plugin drops junk; wtf is the plugtmp series that gives me half a dozen of those empty files every login. Much of this should be in /run or some other volatile setting. They certainly don't need to persist across logins and/or invocations of the code never mind system boots. -- If you're not part of the solution, you're part of the precipitate. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 4/25/2013 6:46 PM, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 08:44 PM:
The problem is not really the script not cleaning up, but programs not cleaning after themselves. Have a look:
drwx------ 2 cer users 4096 Mar 4 2009 keyring-EJGokz [snip]
Those programs are not clearing when they close, and each time they start they create again another temporary folder, or socket, or whatever.
Argh! OUCH! Don't get me started...
-rw------- 1 anton users 132300 Apr 23 11:38 04129517b8c48 -rw------- 1 anton users 132300 Apr 23 11:38 04129517c66e7 -rw------- 1 anton users 132300 Apr 23 11:38 04129517f8883 -rw------- 1 anton users 132300 Apr 23 11:38 0412951829d7d -rw------- 1 anton users 132300 Apr 23 12:05 042515178a8fd -rw---
Thunderbird and its gpg plugin drop junk; ssh uses /tmp instead of /run; thunderbird's calendar plugin drops junk; wtf is the plugtmp series that gives me half a dozen of those empty files every login.
Much of this should be in /run or some other volatile setting. They certainly don't need to persist across logins and/or invocations of the code never mind system boots.
The other day I ripped a few CDs using K3B. After I copied them to the device I wanted them on, I deleted them from my Music directory. Yet they remained in /tmp/kde-[login]. There was a huge amount of storage consumed by these files. Since my /home is on a much bigger drive than / (and by extension /tmp) this presents a rather large problem. If enough users delete directories of huge files this could over-run /tmp. (Note that I already moved set my k3b tmp directory to my own space on /home. These files left if /tmp were not put there by K3B, but rather Dolphin doing a directory delete. I didn't believe it, so I repeated it several times. Anytime you delete an entire directory, in Dolphin, it will often show up in /tmp and it can be huge. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2013-04-25 at 21:46 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 08:44 PM:
Those programs are not clearing when they close, and each time they start they create again another temporary folder, or socket, or whatever.
Argh! OUCH! Don't get me started...
:-)
Thunderbird and its gpg plugin drop junk; ssh uses /tmp instead of /run; thunderbird's calendar plugin drops junk; wtf is the plugtmp series that gives me half a dozen of those empty files every login.
Much of this should be in /run or some other volatile setting. They certainly don't need to persist across logins and/or invocations of the code never mind system boots.
Well, I'm using 12.1, so /run appeared in this version. Developpers will have to catch on that, with time. But in any case, that a program leaves temporary files on exit should be the exception, not the norm. Using a directory in memory to clear it on boot, is a hack to solve a problem that should not be there. Maybe... maybe when a program requests a temporary file, and it crashes, the OS should delete those files automatically. Or maybe not, to investigate the crash. Or maybe they should be erased on a normal finish only. Or maybe not, because another program is going to use them. Or... - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF55SwACgkQtTMYHG2NR9Vr6QCfTpd4aP8945fII23yNHKgPVOd ZEMAnRy/2ZpRyXH9jEHGHAlBBknFkFeR =LeTa -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. said the following on 04/25/2013 10:23 PM:
Well, I'm using 12.1, so /run appeared in this version. Developpers will have to catch on that, with time. But in any case, that a program leaves temporary files on exit should be the exception, not the norm. Using a directory in memory to clear it on boot, is a hack to solve a problem that should not be there.
Maybe... maybe when a program requests a temporary file, and it crashes, the OS should delete those files automatically. Or maybe not, to investigate the crash. Or maybe they should be erased on a normal finish only. Or maybe not, because another program is going to use them. Or...
Or none of the above. For a long while now there have bee how-to guides about this yet we still have people who don't follow simple 'good practice' that is 'play nice with others' and 'pick up after yourself'. I almost said that it was people crossing over from Windows who didn't understand multi-user systems but I suspect its not as simple as that. Yes, open the file them delete it while its open means that the process has use of it but that the OS will clean up after the processes exits, whether it closes it or not, whether the process exits gracefully or crashes. Simple, eh? Been UNIX practice for a long time before Linux was around. Why don't application writer read things like 'The Unix Programming Environment"? http://www.amazon.com/Unix-Programming-Environment-Prentice-Hall-Software/dp... http://en.wikipedia.org/wiki/The_Unix_Programming_Environment The wikipedia article makes it sound out of date but it isn't. ftp://delta.cs.cinvestav.mx/jorge/unix-programming-environment-BrianWKernighan-RobPike.pdf -- There is nothing wrong with America that the faith, love of freedom, intelligence and energy of her citizens cannot cure. -- Dwight D. Eisenhower -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2013-04-25 at 23:18 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 10:23 PM:
Or none of the above. For a long while now there have bee how-to guides about this yet we still have people who don't follow simple 'good practice' that is 'play nice with others' and 'pick up after yourself'. I almost said that it was people crossing over from Windows who didn't understand multi-user systems but I suspect its not as simple as that.
No, it is not Windows mindset. I learnt programming with msdos, and my programs cleared after themselves, unless they crashed.
Why don't application writer read things like 'The Unix Programming Environment"?
http://www.amazon.com/Unix-Programming-Environment-Prentice-Hall-Software/dp... http://en.wikipedia.org/wiki/The_Unix_Programming_Environment The wikipedia article makes it sound out of date but it isn't. ftp://delta.cs.cinvestav.mx/jorge/unix-programming-environment-BrianWKernighan-RobPike.pdf
I'll have a (light) look. 369 pages... :-) - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6VmMACgkQtTMYHG2NR9VTbwCeL3IX5n2+O7ieidp5q6Ztd3UK 8uMAn2cUwpzph9V8RYXpWFtKrC1hK1LV =Dd2j -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 4/26/2013 3:26 AM, Carlos E. R. wrote:
On Thursday, 2013-04-25 at 23:18 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 10:23 PM:
Or none of the above. For a long while now there have bee how-to guides about this yet we still have people who don't follow simple 'good practice' that is 'play nice with others' and 'pick up after yourself'. I almost said that it was people crossing over from Windows who didn't understand multi-user systems but I suspect its not as simple as that.
No, it is not Windows mindset. I learnt programming with msdos, and my programs cleared after themselves, unless they crashed.
Agreed, its just as likely just crappy programming, where programmers come rely on EXACTLY the subject of this entire thread (clean tmp directories automatically) rather than cleaning up after themselves. Most of my adult life I've been programming for the Windows environment, and I have yet to find a use case where I had to write a socket to disk even when I had thousands of them open at once. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
John Andersen wrote:
On 4/26/2013 3:26 AM, Carlos E. R. wrote:
On Thursday, 2013-04-25 at 23:18 -0400, Anton Aylward wrote:
Carlos E. R. said the following on 04/25/2013 10:23 PM:
Or none of the above. For a long while now there have bee how-to guides about this yet we still have people who don't follow simple 'good practice' that is 'play nice with others' and 'pick up after yourself'. I almost said that it was people crossing over from Windows who didn't understand multi-user systems but I suspect its not as simple as that.
No, it is not Windows mindset. I learnt programming with msdos, and my programs cleared after themselves, unless they crashed.
Agreed, its just as likely just crappy programming, where programmers come rely on EXACTLY the subject of this entire thread (clean tmp directories automatically) rather than cleaning up after themselves.
Most of my adult life I've been programming for the Windows environment, and I have yet to find a use case where I had to write a socket to disk even when I had thousands of them open at once.
The sockets you find in the file-system are UNIX sockets. AFAIK, there is no such concept as "write a socket to disk". -- Per Jessen, Zürich (16.9°C) http://www.dns24.ch/ - free DNS hosting, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
El 26/04/13 07:26, Carlos E. R. escribió:
No, it is not Windows mindset. I learnt programming with msdos, and my programs cleared after themselves, unless they crashed.
This is exacty why systemd uses (or better said, can use) per-service temporary directories that are cleaned up on exit, whenther the application likes it or not. Of course this does not apply to sysvinit or applications that are not launched as system service, like desktop apps. I am not convinced that programmers are to take 100% of blame of this mess, If you want me to blame something, I blame the libc APIs that standards bodies and committees (read:bureaucrats) have unleashed on us over the years. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 17:20 -0300, Cristian Rodríguez wrote:
El 26/04/13 07:26, Carlos E. R. escribió:
No, it is not Windows mindset. I learnt programming with msdos, and my programs cleared after themselves, unless they crashed.
This is exacty why systemd uses (or better said, can use) per-service temporary directories that are cleaned up on exit, whenther the application likes it or not.
I do not know if seahorse (one of the culprits) can use such features. The pico editor leaves lots of temporary files. Cups creates dozens of symlinks to the same '/etc/cups/ppd/cp1510n_ps.ppd' file once and again.
Of course this does not apply to sysvinit or applications that are not launched as system service, like desktop apps.
Yep.
I am not convinced that programmers are to take 100% of blame of this mess, If you want me to blame something, I blame the libc APIs that standards bodies and committees (read:bureaucrats) have unleashed on us over the years.
I'm not a Linux programmer, what I used was things like Borland C, or Borland Pascal, variants of GWBasic, or things like Labview or LabWindows. In Linux I have used Lazarus a bit, so forgive me if I'm not up to date with libc :-) I understand than in Linux you can "capture" kill signals, and do actions on them, like clearing out on emergency exit; even bash scripts can do that. Is this not done, are there dificulties I'm not aware of to do that? - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF7GmQACgkQtTMYHG2NR9XH+QCdF3dC7wCDXiM60EWZyXpcJ6mv E1UAni/agLCYc6ehAD3oHTkkVoWWb8Ag =X5eL -----END PGP SIGNATURE-----
El 26/04/13 21:22, Carlos E. R. escribió:
I understand than in Linux you can "capture" kill signals, and do actions on them, like clearing out on emergency exit; even bash scripts can do that.
Read this lwn piece.. the title expresses it all though "Ghosts of Unix past, part 3: Unfixable designs" section "Unix signals" https://lwn.net/Articles/414618/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 21:35 -0300, Cristian Rodríguez wrote:
El 26/04/13 21:22, Carlos E. R. escribió:
I understand than in Linux you can "capture" kill signals, and do actions on them, like clearing out on emergency exit; even bash scripts can do that.
Read this lwn piece.. the title expresses it all though "Ghosts of Unix past, part 3: Unfixable designs" section "Unix signals"
Ugh. Fortunately, I will never really be a Linux dev ;-) - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF7Q0QACgkQtTMYHG2NR9VSigCfYfCLeqaEahbzSw1/fvTMfexo sp8An31TPtrzklSoD9+stdx8wU4Yn7/A =IQ19 -----END PGP SIGNATURE-----
Carlos E. R. said the following on 04/26/2013 08:22 PM:
I understand than in Linux you can "capture" kill signals, and do actions on them, like clearing out on emergency exit; even bash scripts can do that.
Is this not done, are there dificulties I'm not aware of to do that?
Of course its done - by "Good" programmers. And "not done" by ones who cause the kind of problems we are discussing. "Difficulties"? No more so than anything else - as you point out, it can be done in shell scripts too, so why isn't it done in *EVERY* shell script? The problem isn't a technical one. -- People seldom improve when they have no other model but themselves to copy after. - Oliver Goldsmith -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----Original Message-----
From: Carlos E. R.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 11:21 +0200, Hans Witvliet wrote:
One of the other options there, is to wipe entire /tmp during startup (only safe moment, because of sockets and other stuff)
I know. But I always felt that I might want to look there after a crash, and I do save files there, manually, sometimes.
If you think it takes too long, you might try the SUNos way: they just do a reformat..
X'-) - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6VuEACgkQtTMYHG2NR9W94QCfcC2noM0OnSiHK4UfVUh6AzxI zV4AnRfPWH/c7V/4vGkSqt6LqLl28H4u =Gxrn -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/26/2013 12:21 PM, Hans Witvliet wrote:
If you think it takes too long, you might try the SUNos way: they just do a reformat..
- can one use mkfs to do : mkfs -t ext4 /tmp ?? ........................ thanks best regards -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 13:41 +0300, ellanios82 wrote:
On 04/26/2013 12:21 PM, Hans Witvliet wrote:
If you think it takes too long, you might try the SUNos way: they just do a reformat..
- can one use mkfs to do :
That's a reformat.
mkfs -t ext4 /tmp ??
/tmp is a directory, not a device. You can not format a directory. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6XUUACgkQtTMYHG2NR9WzswCeP7s+QyP4civ8fBVHfx3n7NaP bOEAniPsOl9St2UNRUqPY+RneGqYBbQt =2pGd -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/26/2013 01:56 PM, Carlos E. R. wrote:
mkfs -t ext4 /tmp ??
/tmp is a directory, not a device. You can not format a directory.
____________ - thank you ~ i did note that : http://linux.about.com/od/commands/l/blcmdl8_mkfs.htm mentions " filesys is either the device name or the mount point ) " ............... ~ wondered if maybe, /tmp might be considered a 'mount-point' ................... best regards -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 15:11 +0300, ellanios82 wrote:
On 04/26/2013 01:56 PM, Carlos E. R. wrote:
mkfs -t ext4 /tmp ??
/tmp is a directory, not a device. You can not format a directory.
- thank you
~ i did note that : http://linux.about.com/od/commands/l/blcmdl8_mkfs.htm
mentions " filesys is either the device name or the mount point ) "
...............
~ wondered if maybe, /tmp might be considered a 'mount-point'
It is a mount point if you created it as a mount point, ie, if you are mounting something in there. You can check for yourself: cer@Telcontar:~> mount | grep /tmp cer@Telcontar:~> So, in my computer, it is not a mountpoint. Now, that page. It says: mkfs is used to build a Linux file system on a device, usually a hard disk partition. filesys is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point (e.g. /, /usr, /home) for the file system. blocks is the number of blocks to be used for the file system. ... Important: Use the man command (% man) to see how a command is used on your particular computer. Now, verify what the actual man page says: mkfs is used to build a Linux filesystem on a device, usu- ally a hard disk partition. The device argument is either the device name (e.g. /dev/hda1, /dev/sdb2), or a regular file that shall contain the filesystem. The size argument is the number of blocks to be used for the filesystem. Do you see the difference? Nothing about "mount points". Actually, the device that you are going to "format" can not be mounted. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6dn8ACgkQtTMYHG2NR9WbfgCfSDtvUkJHS7uSCrlya6fk639W O/sAoILamBlTxgt7ve4WOGbIVWnsLNLA =mxDH -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
ellanios82 said the following on 04/26/2013 08:11 AM:
~ wondered if maybe, /tmp might be considered a 'mount-point'
Yes it can be considered a 'mount point'. You can mount a file system there. Stick a USB device in and mount -t vfat /dev/sdb1 /tmp And then LO! you have a file system mounted at that point. I think you better stop and think more about what you are asking and trying to do. I regularly have a partition - LVM makes that easy - which I mount as /tmp. There was, if you recall, a vulnerability which involved having hard links between files in /tmp and in the root file system (q.v.) which having a separate file system niftily foiled. Rather than reading 'mkfs' you might want to read the man page for 'losetup'. With this I can treat a regular file as if it were a file system. Well OK, first you have to make the file appear to be a device :-) -- The great successful men of the world have used their imagination ... think ahead and create their mental picture in all it details, filling in here, adding a little there, altering this a bit and that a bit, but steadily building - steadily building. -- Robert Collier -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 08:45 -0400, Anton Aylward wrote:
ellanios82 said the following on 04/26/2013 08:11 AM:
~ wondered if maybe, /tmp might be considered a 'mount-point'
Yes it can be considered a 'mount point'. You can mount a file system there. Stick a USB device in and
mount -t vfat /dev/sdb1 /tmp
And then LO! you have a file system mounted at that point.
Yes, but that will break the running system, because: * current temporary files used by applications at the /tmp directory become suddenly unavailable. You have to go to run level 1 at least before doing that change. * vfat is not a Linux filesystem, so you can not create symlinks, hardlinks, sockets, etc on them - and /tmp does have a lot of those.
I think you better stop and think more about what you are asking and trying to do.
Indeed! :-) - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6fCkACgkQtTMYHG2NR9VP5ACdGy0aJCyyHkwj/DbHXDY6hthQ 7tMAnAiRX+dNNkqnO4GnqV6O/jTwn6SU =A9Zt -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/26/2013 03:45 PM, Anton Aylward wrote:
and think more about what you are asking and trying to do.
- thank you anton : . . . not trying to do anything . . . just wondering what means ??: _____________ On 04/26/2013 12:21 PM, Hans Witvliet wrote:
If you think it takes too long, you might try the SUNos way: they just do a reformat..
Thus : If one wants to Clean tmp directories, IS the "SUNos way" to reformat ones entire Hard Disk, OR, to reformat only the tmp directories ?? Thus : what means the SUNos way ?? ............... best regards -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
ellanios82 said the following on 04/26/2013 09:32 AM:
On 04/26/2013 03:45 PM, Anton Aylward wrote:
and think more about what you are asking and trying to do.
- thank you anton : . . . not trying to do anything . . . just wondering what means ??: _____________
On 04/26/2013 12:21 PM, Hans Witvliet wrote:
If you think it takes too long, you might try the SUNos way: they just do a reformat..
Thus : If one wants to Clean tmp directories, IS the "SUNos way" to reformat ones entire Hard Disk, OR, to reformat only the tmp directories ??
Thus : what means the SUNos way ??
I don't know if you're being difficult or if you can't se the difference between a directory and a file system. I mkfs a file system on a disk partition and then I mount that file system at a mount point. Just like the man page says. Look at what's in /etc/fstab for example: # Entry for /dev/sda5 : UUID=053bfbd4-648d-460a-afa7-c72a41e18c5a / ext2 acl,relatime 1 1 # Entry for /dev/sda1 : UUID=9a16fc63-8f6c-43c1-83ac-466e0af3dd2f /boot ext3 acl,relatime 1 2 # Entry for /dev/sda6 : UUID=99b779e3-cfbb-4cab-9671-38e61efc605f swap swap defaults 0 0 [snip] /dev/vgmain/home /home reiserfs default 1 2 /dev/vgmain/vgTMP /tmp reiserfs default 1 2 There you are, I have /tmp as a separate file system that is mounted on /tmp I could do what SUNOS does and reformat that PARTITION before mounting it at boot time. As it happens I don't. YMMV. You don't format a directory, you format a partition. That the partition is the whole drive (disk, usb, ssd) or loopback device - however that is implemented - is beside the point. If the device you are using as the tmpFS is a whole disk then yes you format the whole disk. If you have lots of memory you might use a tmpFS as the tmp file system. That would make some operations such as compiling quite fast, MAYBE. It depends on how much memory you have and whether the OS decides to flush buffers or not. Sometimes Linux can run completely in memory. I keep saying "Context is Everything" but people often ask questions and make assertions without giving context. On one of my machines I'm running BtrFS and have no other partitions, so there is no /tmp to mount. BtrFS makes very efficient use of space so I never have to worry about such things as running out of inodes when I still have data space as I would with ext{234}. Devoting the whole of the system to BtrFS allows it to make optimizations that partition into separate FS would not allow. Go google on that. -- They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 16:32 +0300, ellanios82 wrote:
On 04/26/2013 03:45 PM, Anton Aylward wrote:
Thus : If one wants to Clean tmp directories, IS the "SUNos way" to reformat ones entire Hard Disk, OR, to reformat only the tmp directories ??
Thus : what means the SUNos way ??
Reformat the /tmp _partition_, of course: not the entire root, that would destroy the system. Not the /tmp directory, that is impossible to achieve. You must read documentation on what is a filesystem, a partition, a mount point... ie, a unix/linux book. Traditionally, unix used several partitions for different things and reasons; not only the current root, home, and swap. You could have a partition for /tmp, because you could make it noexec, if it filled completely the rest of system would be safe, etc. You could have a partition for "/var/spool/news" to set it up with more inodes and smaller records. You could have different physical disks for /usr, because you could read it in parallel and speed up the system. Same for swap. You could have a raw partition for a database, not formatted, because it run faster. I remember some years ago, in Linux, that to be able to burn CDs, it needed a separate raw partition, where the image to be burn was created and could be read faster without filesystem overhead. If the read was not fast enough, the burning software could be out of data and the CD would be used as coffe dish instead. Or hanging from fruit trees to scare birds. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF6imIACgkQtTMYHG2NR9WCYACffEH9N+x7puyg71O9YzkSg/Yi 290An1SfYuwDmtt0/qtIvMD7AxuKHTUd =QeU5 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Fri, 26 Apr 2013, Carlos E. R. wrote:
I'm still using 12.1, systemv mode.
So do I ;)
Telcontar:/etc/cron.daily # ls -ltr /tmp | grep cer | head drwx------ 2 cer users 299008 Jan 1 1970 orbit-cer drwx------ 2 cer users 4096 Jan 9 2008 keyring-XX4s2Z [..]
Non-empty directories...
and files:
srwxr-xr-x 1 cer users 0 Jan 31 2010 filezYgwBN srwxr-xr-x 1 cer users 0 Jan 31 2010 filewinvfe
No, sockets.
+ find /tmp/. -xdev '(' '!' -user root ')' '!' -type d '!' -type s '!' -type p '(' -atime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rm '{}' ';'
... find and delete only files (no dirs, sockets nor pipes)...
+ find /tmp/. -xdev -depth -mindepth 1 '(' '!' -user root ')' -type d -empty '(' -mtime +30 -a -ctime +30 ')' -exec /usr/bin/safe-rmdir '{}' ';'
... find and delete only _empty_ directories ...
What is wrong?
Nothing. Works as designed. The easy way, how I have it setup as well: ==== /etc/fstab ==== tmp /tmp tmpfs nodev,nosuid,noexec 0 0 ==== Of course, you can't keep files there any longer. Use e.g. ~/tmp. HTH, -dnh -- "Any setuid root program that does an exec() somewhere is just a less user friendly version of su." -- Olaf Kirch on bugtraq 2000-08-07 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2013-04-26 at 16:35 +0200, David Haller wrote:
On Fri, 26 Apr 2013, Carlos E. R. wrote:
What is wrong?
Nothing. Works as designed.
Yes, I have already been told that :-)
The easy way, how I have it setup as well:
==== /etc/fstab ==== tmp /tmp tmpfs nodev,nosuid,noexec 0 0 ====
Yes, but you can not keep large files there. I would instead clean on boot. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF7GxsACgkQtTMYHG2NR9W3jgCgiVeQP6ZRDkdgyLEZoQGIspSL TlQAn1PkGHj040Up9QcPuyThZQb1q+Vu =iHXw -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sat, 27 Apr 2013 02:26:03 +0200 (CEST) Carlos E. R. wrote: <snipped>
On Friday, 2013-04-26 at 16:35 +0200, David Haller wrote:
On Fri, 26 Apr 2013, Carlos E. R. wrote:
What is wrong?
Nothing. Works as designed.
Yes, I have already been told that :-)
The easy way, how I have it setup as well:
==== /etc/fstab ==== tmp /tmp tmpfs nodev,nosuid,noexec 0 0 ====
Yes, but you can not keep large files there. I would instead clean on boot.
- -- Cheers, Carlos E. R.
So, is there a proposed 'official' solution for this? I have plenty of space available, too, but that isn't the point. It seems just crazy to allow /tmp to fill up and up and up, no end in sight. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Fri, 26 Apr 2013, Carl Hartung wrote:
Carlos E. R. wrote: <snipped>
On Friday, 2013-04-26 at 16:35 +0200, David Haller wrote:
On Fri, 26 Apr 2013, Carlos E. R. wrote:
What is wrong?
Nothing. Works as designed.
Yes, I have already been told that :-)
Well, my point was mostly explaining what those find commands do ;)
The easy way, how I have it setup as well:
==== /etc/fstab ==== tmp /tmp tmpfs nodev,nosuid,noexec 0 0 ====
Yes, but you can not keep large files there. I would instead clean on boot.
So, is there a proposed 'official' solution for this? I have plenty of space available, too, but that isn't the point. It seems just crazy to allow /tmp to fill up and up and up, no end in sight.
Probably adding
====
#!/bin/bash
# make bash handle globbing safely for this usecase
shopt -u nullglob
shopt -s failglob
# split rm's into two globs because of how failglob works[1]
rm -rf /tmp/.*
rm -rf /tmp/*
====
to /etc/init.d/boot.local or whatever can be used equivalently with
systemd.
That of course requires that nothing already needs stuff in /tmp/ at
that point when the above script-fragment is executed. If something
needed it before or needs if after, nor probs. Here, with sysVinit it
would work (but I'm using tmpfs anyway), as I've only got X-related
stuff (directly X, KDE, Orbit, etc.) in there (and tmpfiles from
XEmacs/mutt etc.), i.e. stuff that get's started long after boot.local
has been run (or not at all if I remain in Runlevel 3 and don't start
e.g. mutt/XEmacs ;).
-dnh
[1] it'll emit an error message if ANY glob fails and will NOT execute
the command. One might want to add a '2>/dev/null' because of that
after each of the 'rm -rf GLOB' commands. Not sure if you need
both 'shopt's, but I have normally nullglob set and failglob
unset.
COMMAND null- fail- OUTPUT
glob glob
echo a.* - - a.*
ls a.* - - ls: cannot access a.*: No such file or directory
echo a.* X - <empty>
ls a.* X -
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2013-04-27 at 07:41 +0200, David Haller wrote:
On Fri, 26 Apr 2013, Carl Hartung wrote:
Carlos E. R. wrote:
Yes, but you can not keep large files there. I would instead clean on boot.
So, is there a proposed 'official' solution for this? I have plenty of space available, too, but that isn't the point. It seems just crazy to allow /tmp to fill up and up and up, no end in sight.
Probably adding
==== #!/bin/bash # make bash handle globbing safely for this usecase shopt -u nullglob shopt -s failglob # split rm's into two globs because of how failglob works[1] rm -rf /tmp/.* rm -rf /tmp/* ====
to /etc/init.d/boot.local or whatever can be used equivalently with systemd.
You don't need any of that to clean on boot. Just edit "/etc/sysconfig/cron": CLEAR_TMP_DIRS_AT_BOOTUP="yes" It should still work for /tmp, but I heard it does not work for directories controlled by systemd. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlF7wqEACgkQtTMYHG2NR9UO9QCfT7yIrfLPO3cCP9XXPSlUqEeJ MQ0AmgL1wiZJrCKI8UaqM+MojLKr5bUS =kHvj -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (10)
-
Anton Aylward
-
Carl Hartung
-
Carlos E. R.
-
Carlos E. R.
-
Cristian Rodríguez
-
David Haller
-
ellanios82
-
Hans Witvliet
-
John Andersen
-
Per Jessen