LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remove user, but systemd? (https://www.linuxquestions.org/questions/linux-newbie-8/remove-user-but-systemd-4175603638/)

John_Brass 04-11-2017 09:09 AM

Remove user, but systemd?
 
I want to remove a user. Well known, this happens with "userdel". But:

sudo userdel baduser
userdel: user baduser is currently used by process 2961

Well, as wise people say, kill process 2961. But this process is "systemd"!!! I surely do not want to kill systemd! What to do?

John_Brass 04-11-2017 09:43 AM

Well, problem solved. After full reboot systemd released baduser.

r3sistance 04-11-2017 09:46 AM

are you sure it is a legitimate systemd process and not something that has renamed itself systemd? Systemd usually runs at PID 1 after all. I'd check what it's parent is

Code:

ps -o ppid,pid,command | grep "2961"
or
Code:

ps auxf | less
you should be able to track it back to what spawned it from that.

John_Brass 04-11-2017 09:57 AM

Interesting. You are right, PID 1 is systemd. But even after reboot there are other systemd instances appear, like PID 1245, PID 1590. Sorry I am not an expert in systemd.

The first command gives only grep itself.
The second command for both: /lib/systemd/systemd --user

vincix 04-11-2017 12:11 PM

I would also check what "it's" ppid is. Systemd means several processes. It's normal. The first comand shows only processes within that particular session (not very useful) and the second doesn't show the PPID. So I'd suggest ps -ef | grep systemd. For instance:
Quote:

root 1 0 0 Mar17 ? 00:02:14 /usr/lib/systemd/systemd --switched-root --system --deserialize 20
root 425 1 0 Mar17 ? 00:01:10 /usr/lib/systemd/systemd-journald
root 452 1 0 Mar17 ? 00:00:00 /usr/lib/systemd/systemd-udevd
dbus 584 1 0 Mar17 ? 00:01:10 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root 603 1 0 Mar17 ? 00:00:37 /usr/lib/systemd/systemd-logind

ondoho 04-11-2017 01:17 PM

on my system, pid 1 is 'init'.
however:
Code:

ls -al /sbin/init
lrwxrwxrwx 1 root root 22 Jan 29 00:32 /sbin/init -> ../lib/systemd/systemd*


sundialsvcs 04-11-2017 03:48 PM

What someone has done, for some strange reason, is to define a symlink to systemd and call it "init." No idea why.


All times are GMT -5. The time now is 06:31 PM.