I have 18.04 and default desktop (IMHO GNOME) and XFCE. I need my home directories are located on external HDD and I can unmount it at any time.
Today I was surprised when I unmounted HDD and mounted HDD at once and then I tried to get access to XFCE. I got an error:
Unable to Load Failsafe Session
...
I understood that I need to restart XFCE.
xfce4-session-logout
doesn't suit me in that case. It shows dialogue and doesn't log out itself.
When I work I use Windows (where no opportunity to install X11 or emulator of X11) and the remote connection (XRDP, SSH).
After work I do that:
killall -u user1
umount /mnt/hdd1
I can unmount HDD 'cause I do killall
. I manually do these actions via SSH only.
What commands do I need to restart XFCE/GNOME (I think that it has the same problem) without any dialogues via SSH?
UPDATE:
Maybe, I change the structure of unmounting HDD. Let's say I logout DE first. But what commands are?
[logout from DE]
killall -u user1
umount /mnt/hdd1
It seems I need commands for log out all users logged into DE.
umount $HOME
before you logout of a GUI. Maybe I'm missing something in your request, but to me it doesn't make sense (being very risky) – guiverc Oct 06 '20 at 03:42killall
is to give the safety, it correctly completely finish all apps. If I'll do unmount withoutkillall
, HDD doesn't unmount because other apps use it. Withkillall
HDD isn't used by anyone apps. I checked it withlsof
. Or I'm wrong? – Bob Oct 06 '20 at 05:55killall
forbash
,sudo
and other shell apps. – Bob Oct 06 '20 at 07:02