Can not delete new user which use "adduser"

Bug #239069 reported by freet15
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
adduser (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

A post from Cjacker show me that bug, To review this issue, you can doing follow this steps:

1, sudo adduser test ---- then you got a new user named test (also password)

2, use Alt + Ctrl + F2 change to a terminal login as test.

3, logoff from this terminal

4, back to your main terminal or X, and use deluser / userdel to delete user "test", then, here we get is a system warning:
        "can`t delete user test: user is currently log in "

this maybe a bug , maybe a policies for something , maybe system does not update wtmp status unhesitating :)

Tags: hardy lucid
Revision history for this message
Nick Ellery (nick.ellery) wrote :

Thanks for your bug report. I tried to duplicate this error, but failed to succeed. Is anybody else able to reproduce this?

Revision history for this message
freet15 (freet15) wrote :

 I forget to post the version of ubuntu . I got this bug from ubuntu 8.04.

Revision history for this message
Nick Ellery (nick.ellery) wrote :

Yes, I attempted to reproduce this in Hardy, but I did not succeed.

Revision history for this message
freet15 (freet15) wrote : Re: [Bug 239069] Re: Can not delete new user which use "adduser"
  • unnamed Edit (958 bytes, text/html; charset=ISO-8859-1)

Hmm....
    all test must be use command line , you did not use "Users
Administration Tool" ?! But, In my system and some confrere`s, this issue
reproduce every time...... :(

On Wed, Jun 11, 2008 at 12:12 PM, Nick Ellery <email address hidden> wrote:

> Yes, I attempted to reproduce this in Hardy, but I did not succeed.
>
> --
> Can not delete new user which use "adduser"
> https://bugs.launchpad.net/bugs/239069
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Nick Ellery (nick.ellery) wrote :

Yes, I did this via command line following your instructions to reproduce. We will just wait and see if anybody else can duplicate it.

Revision history for this message
Danilo Penna Queiroz (daniloqueiroz) wrote :

i've reproduced this bug.

Revision history for this message
Dereck Wonnacott (dereck) wrote :

I attempted to reproduce this, but I also did not succeed.

As an idea, try your test and then attach the output of ps aux > ps_aux.log

Revision history for this message
Dereck Wonnacott (dereck) wrote :

a second run makes me say.... indeed, I also can confirm.

Revision history for this message
Nick Ellery (nick.ellery) wrote :

Is anybody else able to reproduce this?

Changed in adduser:
importance: Undecided → Medium
importance: Medium → Undecided
Revision history for this message
freet15 (freet15) wrote :

freet15@moon:~$ sudo deluser test1
Removing user `test1' ...
userdel: user test1 is currently logged in
/usr/sbin/deluser: `/usr/sbin/userdel test1' returned error code 8. Exiting.

freet15@moon:~$ sudo userdel test1
userdel: user test1 is currently logged in

freet15@moon:~$ who
freet15 tty7 Jun 11 09:58 (:0)
freet15 pts/1 Jun 11 11:09 (:0.0)
freet15 pts/2 Jun 11 13:21 (:0.0)
freet15 pts/3 Jun 11 11:11 (:0.0)

freet15@moon:~$ ps -aux |grep test
freet15 19820 0.0 0.0 1784 548 pts/3 S+ 14:59 0:00 grep test
================================================
so, I have tried again, still get it.

Revision history for this message
freet15 (freet15) wrote :

This "Bug" maybe between Bach and Glibc ....

Revision history for this message
gert (gert.cuykens) wrote :

I can reproduce
Ubuntu 8.04

~# deluser anne
Removing user `anne' ...
Warning: Removing group `anne', since no other user is part of it.
userdel: user anne is currently logged in
/usr/sbin/deluser: `/usr/sbin/userdel anne' returned error code 8. Exiting.
~# who
root pts/0 2008-06-15 18:50 (...)

Revision history for this message
Nick Ellery (nick.ellery) wrote :

Seems like enough people are able to reproduce this bug.

Changed in adduser:
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

After logging out test, can you please test with "ps -U test -a" whether there are still any processes from user 'test' left?

Revision history for this message
Dereck Wonnacott (dereck) wrote :

>After logging out test, can you please test with "ps -U test -a" whether there are still any processes from user 'test' left?

there are none

Revision history for this message
James (james-jamesan) wrote :

Bumping this bug, as it's in effect.

The user I'm trying to delete is "rtc" and I'm logged in as "watcher". Here's some output:

~: cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.3 LTS"

~: w
 22:46:07 up 8 days, 10:09, 3 users, load average: 0.04, 0.23, 0.12
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
watcher pts/0 99.230.244.23 22:34 0.00s 0.20s 0.00s w

~: who
watcher pts/0 Oct 27 22:34 (99.230.244.23)

~: ps -U rtc -a
  PID TTY TIME CMD
 9991 pts/0 00:00:00 ps

~: pkill -KILL -u rtc

~: sudo deluser rtc
Removing user `rtc' ...
userdel: user rtc is currently logged in
/usr/sbin/deluser: `/usr/sbin/userdel rtc' returned error code 8. Exiting.

~: sudo userdel rtc
userdel: user rtc is currently logged in

Revision history for this message
aWesome (rro0t1) wrote :

Ubuntu 10.04.+1

Revision history for this message
WickedMonkey (primate-wickedmonkey) wrote :

Looks like I've run into this bug as well. Ubuntu server 10.04, 64 bit (installed from an iso image downloaded 27/01/2012 from ubuntu.com).

I logged in to my box using my admin account and then ran 'sudo su' to change to root. To create the [new user] account I:
1. Created linux user [new user] ('useradd [new user]').
2. Created samba user [new user] ('smbpasswd -a [new user]').
3. Wanted to test the account so I 'su [new user]' then 'exit' back to my admin/root shell.
4. I realised I'd mis-type the [new user] username so deleted samba account ('smbpasswd -x [new user]') and tried to delete the linux account 'userdel [new user]'. Got error 'userdel: user [new user] is currently logged in'. I exited the terminal ssh session and logged back in but got same error.

'ps -U [new user] -a' gives me:

  PID TTY TIME CMD
 2837 pts/0 00:00:00 su
 2838 pts/0 00:00:00 bash
 2860 pts/0 00:00:00 ps

If I kill these processes, my admin/root session ends and when I log back in I get the same 'userdel: user [new user] is currently logged in' error. Running 'who' doesn't show [new user] logged in, just the admin account I'm logged in as.

Revision history for this message
WickedMonkey (primate-wickedmonkey) wrote :

Just rebooted my problem box and can run 'userdel ...' with no error. Rebooting is not always an option on a server though.

Changed in adduser (Ubuntu):
assignee: nobody → martincloutier (martincloutier)
status: Confirmed → In Progress
Revision history for this message
Rodney Beede (business2008+launchpad) wrote :

I have a similar issue and it seems to be related to duplicate uid in /etc/passwd for the affected account.

Revision history for this message
papukaija (papukaija) wrote :

@martincloutier: Please don't touch at this bug's status without an explanation. Thanks.

Changed in adduser (Ubuntu):
assignee: martincloutier (martincloutier) → nobody
status: In Progress → New
tags: added: hardy lucid
Changed in adduser (Ubuntu):
status: New → Confirmed
Revision history for this message
sivitri (bruno-joffredo) wrote :
Download full text (4.2 KiB)

#### my system : ####
~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

#### deluser error (in french) : ####
~# deluser --remove-home test
Recherche des fichiers à sauvegarder ou à supprimer...
Suppression des fichiers...
Suppression de l'utilisateur « test »...
Attention ! Le groupe « test » ne contient plus aucun membre.
userdel: user test is currently logged in
/usr/sbin/deluser : « /usr/sbin/userdel test » a retourné le code d'erreur 8. Abandon.

#### files used by test : ####
~# lsof -u test
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
menu-cach 3367 test cwd DIR 8,2 4096 2 /
menu-cach 3367 test rtd DIR 8,2 4096 2 /
menu-cach 3367 test txt REG 8,2 18148 413326 /usr/lib/libmenu-cache1/libexec/menu-cached
menu-cach 3367 test mem REG 8,2 62732 788094 /lib/i386-linux-gnu/libudev.so.0.13.0
menu-cach 3367 test mem REG 8,2 296228 781832 /lib/i386-linux-gnu/libdbus-1.so.3.5.8
menu-cach 3367 test mem REG 8,2 88600 416090 /usr/lib/i386-linux-gnu/gvfs/libgvfscommon.so
menu-cach 3367 test mem REG 8,2 170836 416094 /usr/lib/i386-linux-gnu/gio/modules/libgvfsdbus.so
menu-cach 3367 test mem REG 8,2 47040 788028 /lib/i386-linux-gnu/libnss_files-2.15.so
menu-cach 3367 test mem REG 8,2 42652 788032 /lib/i386-linux-gnu/libnss_nis-2.15.so
menu-cach 3367 test mem REG 8,2 92016 788045 /lib/i386-linux-gnu/libnsl-2.15.so
menu-cach 3367 test mem REG 8,2 30520 788026 /lib/i386-linux-gnu/libnss_compat-2.15.so
menu-cach 3367 test mem REG 8,2 13940 788040 /lib/i386-linux-gnu/libdl-2.15.so
menu-cach 3367 test mem REG 8,2 30684 788031 /lib/i386-linux-gnu/librt-2.15.so
menu-cach 3367 test mem REG 8,2 238984 781913 /lib/i386-linux-gnu/libpcre.so.3.12.1
menu-cach 3367 test mem REG 8,2 21944 392349 /usr/lib/i386-linux-gnu/libffi.so.6.0.0
menu-cach 3367 test mem REG 8,2 83776 788029 /lib/i386-linux-gnu/libresolv-2.15.so
menu-cach 3367 test mem REG 8,2 120748 781889 /lib/i386-linux-gnu/libselinux.so.1
menu-cach 3367 test mem REG 8,2 83572 782053 /lib/i386-linux-gnu/libz.so.1.2.3.4
menu-cach 3367 test mem REG 8,2 13732 391656 /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.3
menu-cach 3367 test mem REG 8,2 1730024 788023 /lib/i386-linux-gnu/libc-2.15.so
menu-cach 3367 test mem REG 8,2 124663 788033 /lib/i386-linux-gnu/libpthread-2.15.so
menu-cach 3367 test mem REG 8,2 1014644 781871 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.3
menu-cach 3367 test mem REG 8,2 317288 391659 /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.3
menu-cach 3367 test mem REG 8,2 1401664 391653 /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.3
menu-cach 3367 test mem REG 8,2 26256 393193 /usr/lib/i386-linux-gnu/gconv/gconv-modules.cache
menu-cach 3367 test mem REG 8,2 134344 788037 /lib/i386-linux-gnu/ld-2.15.so
menu-cach 3367 test 0r CH...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.