sudo su error

Commissario
Joined
16 Oct 2002
Posts
2,777
Location
In the radio shack
Every time I sudo su on a CentOS7 system, I get this error.

Code:
bash: /root/.cache/abrt/lastnotification.Fl580G5f: cannot overwrite existing file
'abrt-cli status' timed out

The number after lastnotification is different every time.

There is a file in /root/.cache/abrt called lastnotification.

I've tried giving it +777 permissions, I get the same error.

I've even deleted it, it makes no difference. It comes back with these permissions.

Code:
-rw-------  1 root root 0 Aug 14 23:27 lastnotification

It's just a little frustrating, anyone know what I can do to fix this?

Thanks.
 
Associate
Joined
18 Apr 2020
Posts
779
As this is the 'automatic bug reporting tool' it may not be entirely necessary, as a nuclear option can you uninstall it?

maybe reinstall afterwards and see if it goes away, do you get the error if you 'sudo su -'?
 
Soldato
Joined
18 Jan 2006
Posts
3,095
Location
Norwich
Commissario
OP
Joined
16 Oct 2002
Posts
2,777
Location
In the radio shack
It's not just the
'abrt-cli status' timed out
message, it's the previous line that's bugging me as well.

Creating a .hushlogin in /root doesn't make any difference :(

Red Hat support subscription, maybe the solution for this will help (I can't see it as I don't have said subscription) - https://access.redhat.com/solutions/3077311
Thanks, that would be really useful is someone is able to look at that for me.
 
Commissario
OP
Joined
16 Oct 2002
Posts
2,777
Location
In the radio shack
I've been able to find that info and basically it's saying to make sure the owner of /root/.cache/abrt/lastnotification is set to root.

Already checked that - It's set correctly.
 
Commissario
OP
Joined
16 Oct 2002
Posts
2,777
Location
In the radio shack
There's something odd.

https://tuxrootsite.wordpress.com/2019/04/18/disable-last-login-message-centos-7/

When I run
>/var/log/lastlog

I get an error...

bash: /var/log/lastlog: cannot overwrite existing file


Which is strangely similar to the error I'm getting when sudo su

bash: /root/.cache/abrt/lastnotification.Fl580G5f: cannot overwrite existing file

I am root - I've logged in and done a sudo su so I should be able to overwrite these files.
 
Associate
Joined
4 Jun 2021
Posts
459
Location
Yorkshire
There's something odd.

https://tuxrootsite.wordpress.com/2019/04/18/disable-last-login-message-centos-7/

When I run
>/var/log/lastlog

I get an error...

bash: /var/log/lastlog: cannot overwrite existing file


Which is strangely similar to the error I'm getting when sudo su

bash: /root/.cache/abrt/lastnotification.Fl580G5f: cannot overwrite existing file

I am root - I've logged in and done a sudo su so I should be able to overwrite these files.

The error from the redirection is possibly the bash noclobber setting. Try

set +o noclobber

and try again.
 
Associate
Joined
4 Jun 2021
Posts
459
Location
Yorkshire
If the error on log in is also due to noclobber being on, then working out where it is being enabled would be key.

It's off on my Centos systems for both root and ordinary users. I don't know if that's a Centos default or not, but I don't recall doing anything to disable it.

Looking back over the thread, you get the error with "sudo su", but not with "sudo su -"? If so, it might be something to do with the environment of your normal user.

Does

Code:
set -o | grep noclobber

show it on or off in the normal user shell? If it is on, then try the "set +o noclobber" before issuing the sudo su.

Could also be something in your sudo config, I guess. For most maintenance, I would use "su -" anyway.
 
Commissario
OP
Joined
16 Oct 2002
Posts
2,777
Location
In the radio shack
Looking back over the thread, you get the error with "sudo su", but not with "sudo su -"? If so, it might be something to do with the environment of your normal user.

It's really inconsistent.

Sometimes I get the single error, sometimes I get both errors, sometimes I get a 'last time I logged on' message, sometimes I don't.

No matter what I try, including the +noclobber from my own login, it literally is different each time I issue the same sudo su or sudo su - command.

However...

sudo -i

Just drops me to a # prompt. No last login message, no error.
 
Associate
Joined
4 Jun 2021
Posts
459
Location
Yorkshire
I don't really have a good idea of where the problem is. But having had a poke around my Centos system both messages are probably coming from the script /etc/profile.d/abrt-console-notification.sh.

There's a bug already against abrt for the cannot overwrite error (https://github.com/abrt/abrt/issues/1371), which is fixed but may not have made it into Centos 7.

Other than the previously mentioned RedHat support article (which I can't read either - I also do not have a subscription), I can't see much about the timeout issue.

The script comes from the abrt-console-notification package which you could probably remove if you don't want to know about any detected problems when you log in.

I'd guess sudo -i doesn't run a login shell and therefore won't run the profile script.
 
Soldato
Joined
29 Apr 2004
Posts
4,889
Location
Bath
It's not just the 'abrt-cli status' timed out message, it's the previous line that's bugging me as well. Creating a .hushlogin in /root doesn't make any difference :( Thanks, that would be really useful is someone is able to look at that for me.

RHEL says to chown last notification to your user and then restart abrtd.
 
Associate
Joined
1 Jun 2007
Posts
818
I had a strange problem similar to this. I logged in as the actual root account from the login screen not "su".

It solved it for me... dunno why "su" is different.
 
Back
Top Bottom