Linux debian 4.9.15-x86_64-linode81 #1 SMP Fri Mar 17 09:47:36 EDT 2017 x86_64 GNU/Linux
On a clean Debian 9 amd64 install the deluser command detects running processes from the user I am trying to delete, while no processes are running under that user. This is only the case when the user has a special UID assigned.
Steps to reproduce on a clean Debian 9 install. I did this on a Linode upon the first login with SSH as root:
root@debian:~# adduser foo
Adding user `foo' ...
Adding new group `foo' (1000) ...
Adding new user `foo' (1000) with group `foo' ...
Creating home directory `/home/foo' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for foo
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@debian:~# adduser foo1234 --uid 101234
Adding user `foo1234' ...
Adding new group `foo1234' (101234) ...
Adding new user `foo1234' (101234) with group `foo1234' ...
Creating home directory `/home/foo1234' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for foo1234
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@debian:~# adduser foo1234 sudo
Adding user `foo1234' to group `sudo' ...
Adding user foo1234 to group sudo
Done.
root@debian:~# su - foo1234
foo1234@debian:~$ sudo su -
[sudo] password for foo1234:
root@debian:~# deluser foo
Removing user `foo' ...
Warning: group `foo' has no more members.
userdel: user foo is currently used by process 4892
/usr/sbin/deluser: `/usr/sbin/userdel foo' returned error code 8. Exiting.
root@debian:~#
root@debian:~# ps aux | grep 4892
foo1234 4892 0.0 0.4 20936 4740 pts/0 S 17:54 0:00 -su
root 4917 0.0 0.0 12788 940 pts/0 S+ 17:55 0:00 grep 4892
As you can see I am unable to delete the user foo because of the running process with pid 4892, which is actually the process from user foo1234
When I do not assign a specific UID to the user foo1234 it works correctly and as expected.
I also used specific UIDs in debian 8, and this issue did not pop up there. It seems to be new in debian 9.
This is my first bug report to Debian so I hope all required information is present and that you are able to reproduce it with the above steps.