LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2017, 10:09 AM   #1
John_Brass
LQ Newbie
 
Registered: Apr 2015
Distribution: Scientific Linux, Linux Mint
Posts: 28

Rep: Reputation: Disabled
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?
 
Old 04-11-2017, 10:43 AM   #2
John_Brass
LQ Newbie
 
Registered: Apr 2015
Distribution: Scientific Linux, Linux Mint
Posts: 28

Original Poster
Rep: Reputation: Disabled
Well, problem solved. After full reboot systemd released baduser.
 
Old 04-11-2017, 10:46 AM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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.
 
Old 04-11-2017, 10:57 AM   #4
John_Brass
LQ Newbie
 
Registered: Apr 2015
Distribution: Scientific Linux, Linux Mint
Posts: 28

Original Poster
Rep: Reputation: Disabled
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

Last edited by John_Brass; 04-11-2017 at 11:01 AM.
 
Old 04-11-2017, 01:11 PM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,052

Rep: Reputation: 78
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
 
Old 04-11-2017, 02:17 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,390
Blog Entries: 9

Rep: Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652Reputation: 3652
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*
 
Old 04-11-2017, 04:48 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 03:44 PM
Remove Systemd from Opensuse Leap and 13.2 bagginmtdoom SUSE / openSUSE 12 11-28-2015 09:15 AM
[SOLVED] Is there a way to remove systemd from Fedora ? nolretou Fedora 14 11-09-2015 09:31 AM
[SOLVED] How to completely remove service from systemd using systemctl? OpenSUSE keithostertag Linux - General 9 08-27-2015 05:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration