LinuxQuestions.org
Visit Jeremy's Blog.
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 11-08-2016, 03:24 PM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
Auto-changing process ID: E.g. vsftp


I am able to start vsftpd manually here:
Code:
[student@localhost etc]$ sudo /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf &
[1] 8105
[student@localhost etc]$ sudo ps aux | grep vsftpd
root       8110  0.0  0.0  52796   564 ?        Ss   13:42   0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
student    8121  4.0  0.0 112644   920 pts/2    S+   13:43   0:00 grep --color=auto vsftpd
[1]+  Done                    sudo /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
Q1: But when it got executed, it got a process ID of 8105.
Then when I use command: ps aux, its process ID is 8110.
This change in process IDs is repeatable!
Why?

Thank you.
 
Old 11-08-2016, 04:31 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
vsftpd is a daemon.

It listens for connections, then spawns a process to support it; then goes back to listen for more.
 
Old 11-08-2016, 04:38 PM   #3
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
vsftpd is a daemon.

It listens for connections, then spawns a process to support it; then goes back to listen for more.
Then why is its OWN process ID disappeared?
After it spawn another process, vsftpd should still be alive, correct?
What did I missed?
 
Old 11-08-2016, 05:11 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Unless there has been a configuration failure I would expect it to still be there. Sometimes debug options are used to force that.

It looks like it terminated - otherwise the sudo command would not have terminated. I would have expected the daemon to detatch and run in the background (though the default appears to disable this).

There ought to be log entries if it failed.

You might try not putting it in the background to see if it operates differently.
 
Old 11-08-2016, 05:33 PM   #5
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post

You might try not putting it in the background to see if it operates differently.
What do you mean?
vsftpd is already in background mode since it is a daemon, correct?
 
Old 11-08-2016, 05:49 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by fanoflq View Post
What do you mean?
vsftpd is already in background mode since it is a daemon, correct?
Not according to the default options. It doesn't put itself in the background.

According to your own command "sudo /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf &" you put the sudo command into the background.

Now if sudo lost access to the terminal for some reason, it could get aborted. But I don't think that is what happened as you got a "[1]+ Done sudo /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf", which is a normal termination.
 
Old 11-08-2016, 09:45 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,239

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
The 'sudo' process is 8105, vsftpd daemonizes itself so it gets a new pid 8110
 
1 members found this post helpful.
Old 11-08-2016, 10:12 PM   #8
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
The 'sudo' process is 8105, vsftpd daemonizes itself so it gets a new pid 8110

Two commands should have two processes.
Thus two process IDs.
That makes more sense.
Thanks.

Side question/observation:
Why are you staying away from CentOS7?

Last edited by fanoflq; 11-08-2016 at 10:14 PM.
 
  


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
VSFTP help streetsofrage Linux - Server 6 01-27-2011 03:48 AM
vsftp alfonso12 Fedora 4 08-23-2006 06:17 AM
vsFTP toejam Linux - Security 6 05-15-2004 09:38 AM
little help with vsftp thanks a2carat Linux - Networking 2 01-30-2004 12:37 PM
vsftp, yes again cawpin Linux - Newbie 2 12-14-2003 01:37 PM

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

All times are GMT -5. The time now is 08:08 AM.

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
Open Source Consulting | Domain Registration