Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6791403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:50:32+00:00 2026-05-26T17:50:32+00:00

I have run a test java program on linux as a testuser as below.

  • 0

I have run a test java program on linux as a testuser as below.

su testuser -c "./java Test" &

When I see the processes, I see that there are 2 processes created.
One as root and this spawns other one owned by testuser.

# ps -ef | grep Test
root     19684 19522  0 19:18 pts/0    00:00:00 su testuser -c ./java Test
testuser  19685 19684  1 19:18 pts/0    00:00:00 ./java Test
root     19699 19522  0 19:18 pts/0    00:00:00 grep Test

Why are 2 processes created here?

Even after I kill the process owned by root, the other one continues to run.
Are there 2 java processes created here?

When I run my web app [ tomcat-spring ] as testuser I see only one process created. Why only one process here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:50:32+00:00Added an answer on May 26, 2026 at 5:50 pm
    • the process with id 19684 is the su command you started.
    • the su process itself then starts the java process as a child process with a different userid
    • the third column in the output above is actually the parent process id from which you can see that the java process has the process 19684 (the su process) as parent

    Killing the child process (19685) should make also the su process terminate (at least it does on my system).

    Trying this on my system with sleep 3600 instead of java I see that when killing the su process, su also terminates (sends a signal to) the child process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 java program located seperately One in c:\test and the other in
I am writing a java program, and I have a test to see what
I have a Java program that runs on Linux and telnets into a remote
I have created a script to run a test script on a batch of
We currently have a suite of integration tests that run via MbUnit test suites.
I have the following layout for my test suite: TestSuite1.cmd: Run my program Check
I have a java program that I am trying to generate 3 outputs for,
I have a problem.... I made a java program that does the following: BufferedReader
I have a Java program that executes sh in interactive mode as a subprocess.
I have created an executable Java .jar file. That is to say, I properly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.