Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survive hibernate? :) #155

Open
anttin2020 opened this issue Jun 21, 2020 · 4 comments
Open

Survive hibernate? :) #155

anttin2020 opened this issue Jun 21, 2020 · 4 comments

Comments

@anttin2020
Copy link

anttin2020 commented Jun 21, 2020

This is more like feature request but it also may already be possible to solve with some tricks :)

I use hibernate instead of shutdown and when the computer wakes up, Sirikali shows the mount but it does not (naturally) actually exist. Refresh fixes that (removes the ghost mount from the list) so I can mount it back.
But is there any way to do that automatically or by command-line? I already have check for other network triggered by unlock of the account (which occurs when waking from hibernate) but as there is no 'refresh mounts' or something like that command-line option, it does not help :)

I have all Auto Mount options on and also Re Use Mount Point.

Also the latest version does not show the help with --help, I found the command-line options in another issue but -u does nothing (I could call that on trigger to lock and then just some other like -r for reconnect on unlock).

Any ideas for this? :)

Thank you!

@mhogomchungu
Copy link
Owner

Well, the network need to be functional before you can make network connection.

Does your computer connect automatically when it gets out of hibernation or do you manually connect?

Best way to deal with this is to:

  1. Monitor for network connections.
  2. Add options for favorites to auto connect when networking become available.

@anttin2020
Copy link
Author

anttin2020 commented Jun 24, 2020

I spent hours on trying to create system that checks everything and handles the hibernate:

  1. schedule task for on lock account (going to hibernate)
    -kill sshfs
    -kill Sirikali (as there is no reconnect command line option but it reconnects on start)
    -actually this did not work because hibernate did not wait for these scripts to finish and so sshfs was not killed properly. So I made taskbar button connected to batch that first runs the kills and then calls shutdown -h

  2. schedule task for on unlock account (returning from hibernate)
    -check and wait that network is active
    -check that LAN shares are accessible
    -start Sirikali (with options so that it mounts the drive on startup, this is workaround for missing 'reconnect' command line option :))

I wanted to use only sshfs for simplicity but it won't work from scheduled task, the process is running but the drive won't appear in Computer. I tried with and without start and even some 'start hidden' tools but nothing worked. So I used Sirikali which worked fine for that :)

But the Sirikali auto connect when available did not work on hibernate, without killing Sirikali it was running but could not remount nor unmount anything even manually, the only way was to kill sshfs and sirikali processes and then start it again and mount.

That setup worked quite well but on testing, many times happened something strange: Sirikali and sshfs started and the drive was in Computer but it was unreachable. In addition once even the normal LAN shares were there but unreachable (path not found). The LAN share problem occurred only once but obviously sshfs does not work on hibernate, it failed every 4 or 5 hibernates.

Then I read about many issues, not exactly this but other similar problems when network disconnects and there was suggestions to different software. So I checked them out and SFTPDrive is free for personal use and it worked out of the box, all permissions perfect and everything works and it even handles the reconnect on hibernate :o
It is slightly slower than sshfs but for me the hibernate is more important as I use it daily and I do VSCode coding so the files are not big in terms of file transfer and so the ultimate speed is not that important :)

Time will tell if SFTPDrive actually works well but so far it seems so. And one more advantage: backup program did not see sshfs drive but sees SFTPDrive drive so I can backup the server stuff directly :)

So, sadly sshfs was not solution for me but now I can finally get back to coding instead of tweaking the network system :)

Antti

@anttin2020
Copy link
Author

anttin2020 commented Jun 24, 2020

Oh and the VSCode Local History permission problem occurs with SFTPDrive as well so there must be bug in the extension, it is not related to sshfs :)
I think it tries to create every subfolder on the path and in Windows locally it seems to work but on remote it gets error and fails.

@anttin2020
Copy link
Author

Here again, I'm back to SSHFS :D
I tried several SFTP drive tools but they all failed in long run and used huge amounts of remote server memory - for reason unknown to me. Worst problem was speed - or lack of it - and huge delays when opening even small files.

Anyway, now I'm back to Sirikali/SSHFS-Win and everything is working - haven't really tested hibernate yet, though but first I want to make sure everything else works.
I even found way to keep connection (it dropped due to inactivity), undocumented option:
https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect

So far everything seems to work perfectly, the hibernate thing I will see in few days.

I just wanted to thank you again for all your help and now I know SSHFS/Sirikali is THE method for remote drives :)

Antti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants