LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-18-2024, 03:25 PM   #1
fulalas
Member
 
Registered: Jun 2017
Posts: 149

Rep: Reputation: 34
Executing an application with sudo fires up 3 new instances


Example:

Code:
$ sudo mousepad
Expected behavior (after inputting the correct password): 2 new processes will be fired up: sudo and mousepad
Current behavior: 3 new processes are fired up: sudo, sudo (again) and mousepad

This can also be seen on Ubuntu (live). However, not in Fedora (live) or Manjaro (live).

Not sure what's happening here.
 
Old 02-18-2024, 06:22 PM   #2
elsheepo
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Slackware
Posts: 90

Rep: Reputation: 20
Question

Quote:
Originally Posted by fulalas View Post
Not sure what's happening here.
Me either, give this a try instead
Code:
su --command="mousepad"
or just
Code:
su -c "mousepad"
sudo is not really "good practice" in Slackware.
 
Old 02-18-2024, 06:31 PM   #3
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,409

Rep: Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145Reputation: 4145
Quote:
Originally Posted by elsheepo View Post
sudo is not really "good practice" in Slackware.
From my POV, sudo is always a good practice no matter the distribution
 
1 members found this post helpful.
Old 02-19-2024, 02:38 AM   #4
ctrlaltca
Member
 
Registered: May 2019
Location: Italy
Distribution: Slackware
Posts: 333

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
From https://www.sudo.ws/docs/man/1.8.15/...#Process_model :
Code:
When sudo runs a command, it calls fork(2), sets up the execution
environment as described above, and calls the execve system call in
the child process. The main sudo process waits until the command has
completed, then passes the command's exit status to the security
policy's close function and exits. If an I/O logging plugin is
configured or if the security policy explicitly requests it, a new
pseudo-terminal (“pty”) is created and a second sudo process is used
to relay job control signals between the user's existing pty and the
new pty the command is being run in. This extra process makes it
possible to, for example, suspend and resume the command. Without it,
the command would be in what POSIX terms an “orphaned process group”
and it would not receive any job control signals. As a special case,
if the policy plugin does not define a close function and no pty is
required, sudo will execute the command directly instead of calling
fork(2) first. The sudoers policy plugin will only define a close
function when I/O logging is enabled, a pty is required, or the
pam_session or pam_setcred options are enabled. Note that pam_session
and pam_setcred are enabled by default on systems using PAM.
 
3 members found this post helpful.
Old 02-19-2024, 11:53 AM   #5
fulalas
Member
 
Registered: Jun 2017
Posts: 149

Original Poster
Rep: Reputation: 34
@ctrlaltca, thanks. But then how can we explain Fedora having just one instance of sudo?
 
  


Reply



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
LXer: The Differences between Su, Sudo Su, Sudo -s and Sudo -i LXer Syndicated Linux News 0 09-15-2022 07:47 PM
LXer: MediaTek fires up new ARM Cortex-A17 LXer Syndicated Linux News 0 02-12-2014 11:40 AM
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
sendmail-2: Wrong number of instances of process sendmail:, expected instances equal maxymaxymaxymaxymaxy Linux - Newbie 1 06-15-2011 10:51 AM
LXer: JasperSoft Fires Up New OSS Forge LXer Syndicated Linux News 0 07-23-2008 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:50 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
Open Source Consulting | Domain Registration