nemo

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
munawar
Level 1
Level 1
Posts: 8
Joined: Wed Jun 08, 2016 7:11 am

nemo

Post by munawar » Fri Feb 09, 2018 5:29 pm

Dear friends,

I am trying to use the following terminal command on my linuxmint cinnamon sylvia installation:

ecryptfs-mount-private && nemo Private && ecryptfs-umount-private

The first step 'ecryptfs-mount-private' gets executed correctly and after I enter the password the nemo window also correctly pops up showing Private folder (second step of the command). I can browse through my Private folder but now when I close the nemo window from its button, the third step, i.e., 'ecryptfs-umount-private does not get executed and my Private folder remains mounted.

What do I need to correct this situation?

Please also note that if I use the same command with caja file browser, i.e., 'ecryptfs-mount-private && caja Private && ecryptfs-umount-private' all the three steps are executed correctly.

Looking forward to your help!

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: nemo

Post by Cosmo. » Sat Feb 10, 2018 7:35 am

This is most likely, because Nemo still gets used as a background process (e. g. for showing the desktop icons); following that the Nemo process never quits and consequently the last command never gets executed. I don't think, that you can do anything about it, at least not with Nemo as file manager.

munawar
Level 1
Level 1
Posts: 8
Joined: Wed Jun 08, 2016 7:11 am

Re: nemo

Post by munawar » Sat Feb 10, 2018 1:18 pm

Thanks. I think I should use caja in this case.

JosephM
Level 5
Level 5
Posts: 889
Joined: Sun May 26, 2013 6:25 pm

Re: nemo

Post by JosephM » Sat Feb 10, 2018 3:24 pm

Cosmo. wrote:
Sat Feb 10, 2018 7:35 am
This is most likely, because Nemo still gets used as a background process (e. g. for showing the desktop icons); following that the Nemo process never quits and consequently the last command never gets executed. I don't think, that you can do anything about it, at least not with Nemo as file manager.
This is no longer the case. The desktop now runs in it's own process and you can kill the nemo process without affecting that. The nemo process does die when you've closed all the open windows but it seems to take it's time about it. I'm not sure why but it could be what's keeping that command from working properly.
When I give opinions, they are my own. Not necessarily those of any other Linux Mint developer or the Linux Mint project as a whole.

User avatar
Termy
Level 5
Level 5
Posts: 757
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: nemo

Post by Termy » Sat Feb 10, 2018 7:27 pm

Yes, if the process never ends, then the exit status can never be checked, thus the command won't yet continue. This can be easily demonstrated with: sleep 10s && echo "Finished" You won't see the text until sleep exits (finishes, which is a 0 exit status). The && operator (and) continues if the previous command has an exit status of 0. The || operator (or) continues if the exit status is non-0. Lastly, ; just continues regardless of the previous command's exit status, as it just indicates that the shell should interpret it as a new line.

What you can do is use the &, and possibly followed by disown if run in a terminal, which will stick the previous command into the background, then continue with the next, with the other still running. Try this:

Code: Select all

{ ecryptfs-mount-private && nemo Private; } && ecryptfs-umount-private & disown
Using { ; } to group the commands together, tieing their exit status together as one. So if the first two commands both succeed, then the last will run, and it'll run in the background, disowning itself from the current terminal. (meaning you can close the terminal and it'll still run in the background) It's almost midnight, so hopefully I'm not being super blonde and missing something; pretty tired. :|
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

munawar
Level 1
Level 1
Posts: 8
Joined: Wed Jun 08, 2016 7:11 am

Re: nemo

Post by munawar » Sun Feb 11, 2018 2:56 am

Tried Termy's suggestion and the result was weird. Then tried it without 'disown' but no success. Nemo seems to be pretty obstinate and does not want to say 'quits'.

User avatar
Termy
Level 5
Level 5
Posts: 757
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: nemo

Post by Termy » Sun Feb 11, 2018 2:08 pm

munawar wrote:
Sun Feb 11, 2018 2:56 am
Tried Termy's suggestion and the result was weird. Then tried it without 'disown' but no success. Nemo seems to be pretty obstinate and does not want to say 'quits'.
Can you elaborate on what you mean by the results being "weird"?
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

munawar
Level 1
Level 1
Posts: 8
Joined: Wed Jun 08, 2016 7:11 am

Re: nemo

Post by munawar » Sun Feb 11, 2018 2:40 pm

Hi Termy,

My apologies for incomplete info. It went like this:

munawar@dellc ~ $ { ecryptfs-mount-private && nemo Private; } && ecryptfs-umount-private & disown
[1] 2360
munawar@dellc ~ $ Enter your login passphrase:

Now if I enter the passphrase it is printed in plain text, for example if passphrase is 'password' I get:

munawar@dellc ~ $ Enter your login passphrase:password
WARNING:root:could not open file '/etc/apt/sources.list'

No command 'password' found, did you mean:
Command 'assword' from package 'assword' (universe)
password: command not found
munawar@dellc ~

As you can see the responses are quite strange.

Thanks for your help.

User avatar
Termy
Level 5
Level 5
Posts: 757
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: nemo

Post by Termy » Sun Feb 11, 2018 3:13 pm

Oh wow. Okay, I guess this is down to my lack of familiarity with that encryption program. I didn't realise there was a user input prompt. That would definitely make my suggestion moot. Worth a try.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

Post Reply

Return to “Other topics”