Small delay in sudo Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionESC key causes a small delay in terminal due to its Alt+ behaviorsudo vs “rwx” accessStaggering the authentication delay on failed `su` or `sudo`Passwordless sudo not workingsudo not preserving PS1What is the meaning of sudo sudo?“sudo su -” vs “sudo su” commandWhat is a good balance between strong sudo password and a long delayWhy can I run `sudo bash` but not `sudo su`?Update Zsh prompt with sudo timeout information

How to rotate it perfectly?

Unable to start mainnet node docker container

How to say 'striped' in Latin

Single author papers against my advisor's will?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Stars Make Stars

Can a monk deflect thrown melee weapons?

Array/tabular for long multiplication

I'm having difficulty getting my players to do stuff in a sandbox campaign

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

What's the difference between (size_t)-1 and ~0?

What did Darwin mean by 'squib' here?

Keep going mode for require-package

Working around an AWS network ACL rule limit

Can I throw a longsword at someone?

How does modal jazz use chord progressions?

Why does tar appear to skip file contents when output file is /dev/null?

Was credit for the black hole image misattributed?

Can a zero nonce be safely used with AES-GCM if the key is random and never used again?

What is the electric potential inside a point charge?

Geometric mean and geometric standard deviation

Estimated State payment too big --> money back; + 2018 Tax Reform

Statistical model of ligand substitution

Why use gamma over alpha radiation?



Small delay in sudo



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionESC key causes a small delay in terminal due to its Alt+ behaviorsudo vs “rwx” accessStaggering the authentication delay on failed `su` or `sudo`Passwordless sudo not workingsudo not preserving PS1What is the meaning of sudo sudo?“sudo su -” vs “sudo su” commandWhat is a good balance between strong sudo password and a long delayWhy can I run `sudo bash` but not `sudo su`?Update Zsh prompt with sudo timeout information



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true to determine whether the sudo timestamp is still valid.



This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?










share|improve this question
























  • @JeffSchaller How exactly would that work?

    – 0x539
    Apr 10 at 23:18











  • I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

    – Jeff Schaller
    Apr 11 at 0:17

















2















I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true to determine whether the sudo timestamp is still valid.



This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?










share|improve this question
























  • @JeffSchaller How exactly would that work?

    – 0x539
    Apr 10 at 23:18











  • I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

    – Jeff Schaller
    Apr 11 at 0:17













2












2








2


0






I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true to determine whether the sudo timestamp is still valid.



This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?










share|improve this question
















I want my zsh prompt to display whether the session has sudo rights (from a previously run sudo command). After looking at the answers to this question, I arranged to use the exit status of sudo -n true to determine whether the sudo timestamp is still valid.



This works as intended, however the command takes ca. 15 ms to complete. Actually all sudo commands seem to have this overhead. This is not much, but I notice it and it bothers me. Given that this is not a computationally expensive operation, is there is a faster way to check this?







sudo zsh performance real-time






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 10 at 23:08









Jeff Schaller

45k1164147




45k1164147










asked Apr 10 at 22:32









0x5390x539

12614




12614












  • @JeffSchaller How exactly would that work?

    – 0x539
    Apr 10 at 23:18











  • I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

    – Jeff Schaller
    Apr 11 at 0:17

















  • @JeffSchaller How exactly would that work?

    – 0x539
    Apr 10 at 23:18











  • I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

    – Jeff Schaller
    Apr 11 at 0:17
















@JeffSchaller How exactly would that work?

– 0x539
Apr 10 at 23:18





@JeffSchaller How exactly would that work?

– 0x539
Apr 10 at 23:18













I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

– Jeff Schaller
Apr 11 at 0:17





I've run out of ideas; even if sudo -n true passed, what if you sat at your prompt long enough for the timestamp to run out? That could be minutes or seconds; I don't have a good solution to this problem.

– Jeff Schaller
Apr 11 at 0:17










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511776%2fsmall-delay-in-sudo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511776%2fsmall-delay-in-sudo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.