Disaster strikes! Deleted my /tmp folder

or should I say, all the contents of, and now I cannot log into my user acct. I can only log into root. For years in every version up to 11.3 I always deleted the /tmp /var/tmp folders to clean them up. What do I do now? Why would a critical system start up file be in TMP! I was happily using 11.4 until this disaster struck.

Thanks

Um…
If it ain’t broke DON’T delete it!!!:wink:

I am unaware where the computer keeps it’s important files but all you have to do is repair or reinstall the OS and
since you can login as Root you can backup all your data and settings by coping all the hiden and unhiden files from
your home directory to another sorage medium and then once your computer is up and running agian just login as
Root and copy them back ( overwriting the current files.)
REMEMBER TO CHANGE THE PERMISSIONS SO THAT SOMEONE OTHER THEN ROOT CAN ACCESS THE FILES AND CHANGE THEM!!!

I think it is a permissions problem with /tmp. When I try to login under my user ID, the login in screen disappears like it is going to my desktop, but then I see a quick flash in terminal show a red highlighted error, then it goes right back to the login page. I cannot read the error because it happens so fast. The /tmp file shows root root when I do a ls -l. How am I suppose to use/create a file under root root. Should it be changed to root user, or doug root? Let me know the ls- l setting for you /tmp folder. Thanks

Unfortunetly I have to use a library computer to acess the internet so until monday someone else will have thelp you with ls -l.
Hey, wait a minute, ( if it helps, ) I had a problem many times over whith the permissions and it turned out to be that
in yast I set the file permissions to paraniod and could not login I solved it by setting them to secure.

I was right!! Yay! LOL…I used a chown -R command and changed /tmp from root root to doug root. It works now. I guess I know a lot more about Linux than I think. I do have on problem now, my startup programs give me a KDE error at startup…Must be more permissions BS. I need someone to do an ls -l on their /tmp folder and paste it here. Thanks.

OK. Now totally resolved!

I used the following command in terminal: chgrp users /tmp

Now the permissions of the /tmp file are correct, and everything works fine.

Originally the new /tmp file was root root. I used the command: chown doug /tmp

to get this: “doug root”

then I used the chgrp command to make it " doug users".

At least it is all here if someone else has this problem.

I do not quite understand what you have now, but this is how the access bits and oweer/group of */tmp *should be:

henk@boven:~> ls -dl /tmp
drwxrwxrwt 12 root root 4096 17 mrt 19:30 /tmp
henk@boven:~>

You better make it exactly like that. (mind the t-bit)

And you should of course rethink your usage of root. for the future.

On 2012-03-17 18:06, Doug08 wrote:
>
> I think it is a permissions problem with /tmp. When I try to login under
> my user ID, the login in screen disappears like it is going to my
> desktop, but then I see a quick flash in terminal show a red highlighted
> error, then it goes right back to the login page.

The error might be in the logs.

> I cannot read the
> error because it happens so fast. The /tmp file shows root root when I
> do a ls -l. How am I suppose to use/create a file under root root.

With the right permissions. :slight_smile:

Hint: others.

> Should it be changed to root user, or doug root? Let me know the ls- l
> setting for you /tmp folder. Thanks


drwxrwxrwt 439 root root 32768 Mar 17 22:45 tmp/


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

No, my system will not work properly with /tmp as root root. WITHIN the /tmp file I have folders which are " root root". That is ok. My system has been upgraded so many times(11.0 -11.1- 11.3 - 11.4) that the permissions issue must have arisen from the upgrades.

doug@linux-rvej:~> ls -l /
total 108
drwxr-xr-x 2 root root 4096 Mar 11 01:39 bin
drwxr-xr-x 3 root root 4096 Mar 11 03:36 boot
drwxr-xr-x 19 root root 3620 Mar 17 20:58 dev
drwxr-xr-x 130 root root 12288 Mar 17 19:33 etc
drwxr-xr-x 5 root root 4096 Aug 30 2010 giis
drwxr-xr-x 4 root root 4096 Feb 18 2011 home
drwxr-xr-x 20 root root 12288 Mar 11 03:38 lib
drwx------ 2 root root 16384 Aug 22 2010 lost+found
drwxr-xr-x 8 root root 4096 Mar 17 20:58 media
drwxr-xr-x 3 root root 4096 Feb 18 2011 mnt
drwxr-xr-x 5 root root 4096 Feb 18 2011 opt
dr-xr-xr-x 195 root root 0 Mar 17 19:04 proc
drwx------ 40 root root 4096 Mar 17 20:22 root
-rw-r–r-- 1 root root 2995 May 15 2010 rules.log
drwxr-xr-x 3 root root 12288 Mar 11 21:55 sbin
drwxr-xr-x 2 root root 4096 Feb 18 2011 selinux
drwxr-xr-x 4 root root 4096 Feb 18 2011 srv
drwxr-xr-x 12 root root 0 Mar 17 19:04 sys
drwxr-xr-x 27 doug users 4096 Mar 17 22:00 tmp
drwxr-xr-x 13 root root 4096 Mar 10 23:46 usr
drwxr-xr-x 17 root root 4096 Mar 12 09:30 var

INSIDE /tmp:

doug@linux-rvej:~> ls -l /tmp
total 84
drwx------ 2 doug users 4096 Mar 17 19:05 akonadi-doug.Svv6qc
drwx------ 2 doug root 4096 Mar 17 12:23 akonadi-root.cpYMfC
drwx------ 2 doug users 4096 Mar 17 20:52 flashgot.lklrauws.default
drwx------ 2 doug users 4096 Mar 17 19:05 gpg-4ot9T0
drwx------ 3 doug users 4096 Mar 17 22:05 kde-doug
drwx------ 2 doug root 4096 Mar 17 12:28 kde-root
drwx------ 2 root root 4096 Mar 17 15:25 kde-root01oVlA
drwx------ 2 root root 4096 Mar 17 19:05 kde-root5iqWMG
drwx------ 2 root root 4096 Mar 17 20:11 kde-rootLutvoo
drwx------ 2 doug users 4096 Mar 17 22:13 ksocket-doug
drwx------ 2 doug root 4096 Mar 17 13:02 ksocket-root
drwx------ 2 root root 4096 Mar 17 19:07 ksocket-root8qNr7N
drwx------ 2 root root 4096 Mar 17 19:05 ksocket-rootdqUHVN
drwx------ 2 root root 4096 Mar 17 15:25 ksocket-rootDuUJfD
drwx------ 2 doug users 4096 Mar 17 21:19 mozilla-media-cache
drwx------ 2 doug users 4096 Mar 17 20:33 orbit-doug
drwx------ 2 doug root 4096 Mar 17 13:02 orbit-root
drwx------ 2 doug users 4096 Mar 17 22:04 plugtmp
drwx------ 2 doug users 4096 Mar 17 19:05 pulse-KSB1FebW397V
drwx------ 2 root root 4096 Mar 17 13:02 pulse-Nh8cCx1F303X
drwx------ 2 doug root 4096 Mar 17 12:23 pulse-o5j4nLzr2tL

On 03/17/2012 09:26 PM, Doug08 wrote:
>
> No, my system will not work properly with /tmp as root root. WITHIN the
> /tmp file I have folders which are " root root". That is ok. My system
> has been upgraded so many times(11.0 -11.1- 11.3 - 11.4) that the
> permissions issue must have arisen from the upgrades.
>
> doug@linux-rvej:~> ls -l /
> total 108
> drwxr-xr-x 2 root root 4096 Mar 11 01:39 bin
> drwxr-xr-x 3 root root 4096 Mar 11 03:36 boot
> drwxr-xr-x 19 root root 3620 Mar 17 20:58 dev
> drwxr-xr-x 130 root root 12288 Mar 17 19:33 etc
> drwxr-xr-x 5 root root 4096 Aug 30 2010 giis
> drwxr-xr-x 4 root root 4096 Feb 18 2011 home
> drwxr-xr-x 20 root root 12288 Mar 11 03:38 lib
> drwx------ 2 root root 16384 Aug 22 2010 lost+found
> drwxr-xr-x 8 root root 4096 Mar 17 20:58 media
> drwxr-xr-x 3 root root 4096 Feb 18 2011 mnt
> drwxr-xr-x 5 root root 4096 Feb 18 2011 opt
> dr-xr-xr-x 195 root root 0 Mar 17 19:04 proc
> drwx------ 40 root root 4096 Mar 17 20:22 root
> -rw-r–r-- 1 root root 2995 May 15 2010 rules.log
> drwxr-xr-x 3 root root 12288 Mar 11 21:55 sbin
> drwxr-xr-x 2 root root 4096 Feb 18 2011 selinux
> drwxr-xr-x 4 root root 4096 Feb 18 2011 srv
> drwxr-xr-x 12 root root 0 Mar 17 19:04 sys
> drwxr-xr-x 27 doug users 4096 Mar 17 22:00 tmp
> drwxr-xr-x 13 root root 4096 Mar 10 23:46 usr
> drwxr-xr-x 17 root root 4096 Mar 12 09:30 var
>
>
> INSIDE /tmp:
>
> doug@linux-rvej:~> ls -l /tmp
> total 84
> drwx------ 2 doug users 4096 Mar 17 19:05 akonadi-doug.Svv6qc
> drwx------ 2 doug root 4096 Mar 17 12:23 akonadi-root.cpYMfC
> drwx------ 2 doug users 4096 Mar 17 20:52 flashgot.lklrauws.default
> drwx------ 2 doug users 4096 Mar 17 19:05 gpg-4ot9T0
> drwx------ 3 doug users 4096 Mar 17 22:05 kde-doug
> drwx------ 2 doug root 4096 Mar 17 12:28 kde-root
> drwx------ 2 root root 4096 Mar 17 15:25 kde-root01oVlA
> drwx------ 2 root root 4096 Mar 17 19:05 kde-root5iqWMG
> drwx------ 2 root root 4096 Mar 17 20:11 kde-rootLutvoo
> drwx------ 2 doug users 4096 Mar 17 22:13 ksocket-doug
> drwx------ 2 doug root 4096 Mar 17 13:02 ksocket-root
> drwx------ 2 root root 4096 Mar 17 19:07 ksocket-root8qNr7N
> drwx------ 2 root root 4096 Mar 17 19:05 ksocket-rootdqUHVN
> drwx------ 2 root root 4096 Mar 17 15:25 ksocket-rootDuUJfD
> drwx------ 2 doug users 4096 Mar 17 21:19 mozilla-media-cache
> drwx------ 2 doug users 4096 Mar 17 20:33 orbit-doug
> drwx------ 2 doug root 4096 Mar 17 13:02 orbit-root
> drwx------ 2 doug users 4096 Mar 17 22:04 plugtmp
> drwx------ 2 doug users 4096 Mar 17 19:05 pulse-KSB1FebW397V
> drwx------ 2 root root 4096 Mar 17 13:02 pulse-Nh8cCx1F303X
> drwx------ 2 doug root 4096 Mar 17 12:23 pulse-o5j4nLzr2tL

No matter what you think, /tmp must be owned by root:root. What you are
forgetting is to set the permissions to 777. As root, use


chown root:root /tmp
chmod 777 /tmp

In addition, do not clean out /tmp or /var/tmp by deleting the directories.
Delete the files instead. Even better is to use YaST => System => /etc/sysconfig
Editor under System => Cron to set the maximum time in /tmp and the tmp dirs to
clear.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>

 chown root:root /tmp chmod 777 /tmp 

Minor improvement. This (above) would likely work, but it’s better to
do the following to add the sticky bit on the directory, also as hcvv
mentioned:


chown root:root /tmp
chmod 1777 /tmp

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPZW+RAAoJEF+XTK08PnB5EPgQAK7hk/MblYGGI6JQP2BHvxPG
3Uk8vsR8Zkbre5IGH7JW2p1YmQ3zHTAoRMkyuRU7jZbcSNzQoghjT9psqp8d7d7Z
119JIZTj5N2Dp0pOtcs2qfXM6JJ3JG0jsxaEXR4UT3Kl6ct01tHpCSWM7WvUhMdP
ZjuXCUu/BB4lFOjL0X7cWhovYjrS6h9GsCT6zPLN5AqzCvRYd8YXzKq9w2Q4iljs
yyVY/2zkm34MLyyf8Tmmte0XG6q2lqe/bubSqT1mz8j7HWssW6hGe51mWMmnpyEk
AAQogA+kp1iBCgEiG838aKd693YD3rCGyTz4rjvEzSek+rwmGMChELmYywzO6CW6
Orw1p/F+wBYmFDATQSn9+baEuF5MCdmMz6QqDb7DhMBWJju6QTvyGWG+19Y6OWp7
y71MGcL08ia/5EujgQ5fUbUyinxK7l2xOAvNrwr+KhdImrhi+qJGT8E7N3upnS/T
c06v1q6k4VZDWqtuGZgJQIs/VCHu/OyZLk2C207PJTngzw3IxDIQS/YuM0tR2Z5r
2TCHyi+7IPJNYa0efjbNLek00AK3Iygwq6pije+wIamkZ2pTdhL2cOJHJhihl3DO
TsLksSA5wzRwHL79FSD7aeC9xcHU9gZtP1BDKFOKe1cb3tOEVLOnifuX2N7wBv3L
u7XRQaDFZvq5dll6X3zb
=MVR1
-----END PGP SIGNATURE-----

Also never ever log into a GUI as root. It cause permission problems.

.tmp should always be owned by root.

When the user is owner of /tmp, he does not even have to be root to bork his system. :’(

On 2012-03-18 03:26, Doug08 wrote:
>
> No, my system will not work properly with /tmp as root root.

Yes it will.

Just do the permissions as I posted and it will work.

> WITHIN the
> /tmp file I have folders which are " root root". That is ok. My system
> has been upgraded so many times(11.0 -11.1- 11.3 - 11.4) that the
> permissions issue must have arisen from the upgrades.

Nope.
My system has been upgraded from much earlier than that. I also have
freshly installed systems with tmp the same, owned by root.

> drwxr-xr-x 27 doug users 4096 Mar 17 22:00 tmp

This is wrong. Think: what will happen to the system scripts that run as
“nobody”? They can not write in your tmp directory!


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I don’t seem to understand what everyone is trying to do here…

Apparently the /tmp directory still exists, only the contents are missing.
IMO that means that all these excursions into permissions are totally irrelevant(unless you further mucked up your system by actually changing permissions on your /tmp directory).

When I first did this mistake (wiping out the contents of /tmp), simply logging in as root and then doing a force update of the Desktop (Using YAST or zypper) rebuilt the missing essential folders the GUI Desktop needs for a normal User to logon.

Also, future advice for people who want to clear junk out of the /tmp, /var/tmp and any other folders…

You can do this safely using the utility “tmpwatch” – Install it, then run it manually or as a cron job.

IMO and HTH,
TS

On 2012-03-18 23:16, tsu2 wrote:
>
> I don’t seem to understand what everyone is trying to do here…
>
> Apparently the /tmp directory still exists, only the contents are
> missing.

That was the first issue.

> IMO that means that all these excursions into permissions are totally
> irrelevant(unless you further mucked up your system by actually changing
> permissions on your /tmp directory).

And that is precisely what he did. :slight_smile:

> When I first did this mistake (wiping out the contents of /tmp), simply
> logging in as root and then doing a force update of the Desktop (Using
> YAST or zypper) rebuilt the missing essential folders the GUI Desktop
> needs for a normal User to logon.

That should not be necessary. Software should be clever enough to recreate
tmp directories and folders, that what they are for: temporary space.

What happens then to those people that use /tmp as a ramdisk that is
automatically and completely erased on every reboot?

If software has a problem with this, that software is buggy.

> You can do this safely using the utility “tmpwatch” – Install it, then
> run it manually or as a cron job.

You can do it by simply changing one or two variables in “/etc/sysconfig/cron”.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

When ever I ls my /tmp folder I get a steam locomotive running across my screen!
HA! HA!
Happy to hear you solved the problem.
You may additionaly consider running Bleach bit as root to clean the computer of junk.

Try “ls -ld FOLDERNAME”, i.e.


glosscomputer@laptop:~> ls -ld /tmp
drwxrwxrwt 308 root root 20480 19 mrt 22:35 /tmp

see, it lists only the folder /tmp and it’s permissions.

This issue is widely discussed across the Internet,

You’re correct that you can wipe the entire contents of the TMP directory immediately before shutdown either automatically or manually, the problem is if you wipe the contents but don’t shutdown immediately. But, with an empty TMP directory, the longer you use the system without shutting down, you increase your odds of corrupting the Desktop, and I’ve found that once the Desktop has been corrupted the easiest solution to eradicating the corruption is to simply “force update” (essentially doing a re-install) of the entire Desktop.

TS

On 2012-03-22 02:36, tsu2 wrote:
> This issue is widely discussed across the Internet,
>
> You’re correct that you can wipe the entire contents of the TMP
> directory immediately before shutdown either automatically or manually,
> the problem is if you wipe the contents but don’t shutdown immediately.
> But, with an empty TMP directory, the longer you use the system without
> shutting down, you increase your odds of corrupting the Desktop, and
> I’ve found that once the Desktop has been corrupted the easiest solution
> to eradicating the corruption is to simply “force update” (essentially
> doing a re-install) of the entire Desktop.

You can of course not delete /tmp if the desktop is running, that’s
obvious. You have to logout and switch to runlevel 3. Once deleted, you
should be able to switch back to runlevel 5 and login again.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)