Sublime Forum

Slow save with privileges

#1

I am very happy with that on Linux I can save files as user to root locations again (/etc/hosts etc). however it takes up to 10 seconds for the safe to complete. is this due to the Linux security mechanisms or avoidable?

0 Likes

Freeze with 3176 when saving file with root privileges on Ubuntu 18
#2

Do you have Atomic save enabled?

It is a system which creates a file elsewhere, removes the original file, then copies the new file into its place…

If you have an aging hard-drive or a bad hard-drive, then it could be saving to a few bad sectors, or some other issue… It could also be a plugin using non async callbacks and causing lockups in the ui thread…

Can you give more information about what happens? Is there any data in the console? Have you tried disabling atomic save ( edit preferences and set it to false )… etc…

What all have you tried in terms of debugging…

What plugins do you have installed, if any?

How old is the computer - more specifically the hard-drive and what type of drive is it ( solid state, mechanical, or hybrid )?

How large is the file being saved.

Does the issue only occur on specific file-types or is it affecting all types…

Anything else you can think of to help debug the situation would be fantastic as it shouldn’t take 10 seconds to save - even on a 10 year old pc with a mechanical drive unless the file is massive ( 10s of megabytes or larger )…

0 Likes

#3

maybe your pkexec is slow, and thus the slowdown is caused by that and not ST?

0 Likes

#4

thanks for detailed support!!

I tried with and without atomic save pref.

brand new fast computer, log shows nothing ( after file is created with sudo touch /etc/t)
delay is independent of file size.

there is no delay in /var/log/auth.log
Mar 28 13:11:01 echse sudo: me : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/cp /tmp/.subl208.tmp /etc/t
Mar 28 13:11:01 echse sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 28 13:11:01 echse sudo: pam_unix(sudo:session): session closed for user root

the file is changed immediately it’s just the status dot which doesn’t change until after 10 seconds. sublime text is unresponsive during that time, so it’s not just a cosmetic bug.

one thing I noticed is that pkexec --user me ls opens popup, while sublimetext doesn’t.

0 Likes

#5

can you show a screenshot of what you mean here please?
have you tried with no third party packages installed, in case one of them is doing something funky? https://www.sublimetext.com/docs/3/revert.html

0 Likes

#6

the dot next to file name changes to ‘x’ after 10 sec.

reverted. no difference.

0 Likes

#7

Maybe this is related: I can not save to /etc/ that don’t already exist.

0 Likes

#8

FYI Sublime Text will use /usr/bin/gksudo in preference to pkexec if it’s available, so you may want to test that in a stand alone context too

1 Like

Replace gksu with pkexec on Linux
#9

Thanks, gksudo is the culprit indeed. Takes 10 seconds to return.

0 Likes