LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-19-2019, 08:46 AM   #1
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Rep: Reputation: 57
How can root restart nemo-desktop?


The following commands restart nemo-desktop in peppermintos which is based on ubuntu:

pkill nemo-desktop
nemo-desktop &

This is needed when a VM resumes, and vmware allows you to put the commands in a script that it executes as root when resuming. Except nemo-desktop is not happy with being run as root. It wants to be launched as an ordinary user. But sudo -u user does not work either generating lots of errors as below:

#!/bin/sh
pkill nemo-desktop
sudo -u user nemo-desktop &

(nemo-desktop:4378): dconf-CRITICAL **: 16:50:26.008: unable to create file '/home/user/.cache/dconf/user': Permission denied. dconf will not work properly.

How can nemo-desktop be relaunched from this script, given the script is run as root?

Last edited by Ulysses_; 06-19-2019 at 09:11 AM.
 
Old 06-19-2019, 09:10 AM   #2
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Tried these:

sudo chmod 777 /home/user/.cache/dconf
sudo chmod 777 /home/user/.cache/dconf/user

and it works but takes 14 seconds and still generates errors:

(nemo-desktop:5159): GLib-GIO-CRITICAL **: 17:08:27.308: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(nemo-desktop:5159): libunity-CRITICAL **: 17:08:30.320: unity-launcher.vala:157: Unable to connect to session bus: Could not connect: Connection refused

(nemo-desktop:5159): libunity-CRITICAL **: 17:08:33.332: unity-launcher.vala:157: Unable to connect to session bus: Could not connect: Connection refused

(nemo-desktop:5159): GLib-CRITICAL **: 17:08:33.337: g_strstr_len: assertion 'haystack != NULL' failed
** Message: 17:08:33.337: nemo-desktop: session is not cinnamon (checked XDG_SESSION_DESKTOP,DESKTOP_SESSION environment variables.) Applying default behavior

(nemo-desktop:5159): LIBDBUSMENU-GLIB-WARNING **: 17:08:36.349: Unable to get session bus: Could not connect: Connection refused

(nemo-desktop:5159): LIBDBUSMENU-GLIB-WARNING **: 17:08:36.349: Unable to get session bus: Could not connect: Connection refused
 
Old 06-21-2019, 03:29 AM   #3
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by Ulysses_ View Post
How can nemo-desktop be relaunched from this script, given the script is run as root?
Probably it would help if you explained exactly what kind of system you are doing this on and what you are trying to accomplish exactly. VM? Why? What? Is still still xorg? startx?

But I would think this needs to be started as a non-root user and that you need to deal with PAM to do it correctly.

Last edited by zeebra; 06-21-2019 at 03:32 AM.
 
Old 06-21-2019, 10:27 AM   #4
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
It's xorg and startx, much like ubuntu or perhaps lubuntu or xubuntu - except the file manager is nemo and it shows file icons on the Desktop when nemo-desktop is running. Need to restart nemo-desktop in a VM every time the VM is resumed for reasons that are outside the scope of the question. VMware allows one to run any script automatically on resume except the script is run as root which nemo-desktop is not happy with.

Maybe there is command to make root ignore permissions from now on? Ie not demand chmod for every file set by its owner not to be readable/writable by root?

Last edited by Ulysses_; 06-21-2019 at 10:29 AM.
 
Old 06-21-2019, 12:43 PM   #5
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by Ulysses_ View Post
It's xorg and startx, much like ubuntu or perhaps lubuntu or xubuntu - except the file manager is nemo and it shows file icons on the Desktop when nemo-desktop is running. Need to restart nemo-desktop in a VM every time the VM is resumed for reasons that are outside the scope of the question. VMware allows one to run any script automatically on resume except the script is run as root which nemo-desktop is not happy with.

Maybe there is command to make root ignore permissions from now on? Ie not demand chmod for every file set by its owner not to be readable/writable by root?
VM? Do you run peppermintos in a virtual machine? I don't get it, which is why I asked.

Do you have knowledge on PAM? As you say, you should not start this program as root. I don't understand why you need to "restart nemo" or why it needs to run in a special way. Can you not just run a normal instance or does it need to be a service or a daemon or something weird?

What you want to do, should be easy, but I don't understand your situation, and I think others might have issues too.

Can you not simply use a terminal and start nemo as a user? Normally that should be possible (I don't know Nemo).
 
Old 06-21-2019, 03:12 PM   #6
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by zeebra View Post
VM? Do you run peppermintos in a virtual machine?
Yes, and also as the host where virtual machines are launched from.

Quote:
Do you have knowledge on PAM?
No.

Quote:
you should not start this program as root
The script that will start it is run as root but the actual command that starts it is run as an ordinary user like this: sudo -u user nemo-desktop. But still, this is not the same as typing nemo-desktop on a terminal. Going to a terminal and typing su to become root, and then sudo -u user nemo-desktop does not work for the same reason. Some permission check fails. Wrong environment variables maybe.

Quote:
I don't understand why you need to "restart nemo" or why it needs to run in a special way. Can you not just run a normal instance or does it need to be a service or a daemon or something weird?
In short, because I want another virtual data disk to be plugged to a VM and mounted at the ~/Desktop directory after resume and nemo-desktop to show the new files. Suspend in vmware is like instantly freezing a computer, resume is like instantly thawing it. I want to change a data disk while the computer is frozen. And change the system disk too with a fresh one.

Why on earth would one want to do this you might wonder - I warned you this is outside the scope here, I am generating lots of VM's automatically, all using the same virtual system disk in non-persistent mode so changes they make to their views of it go to their own delta records called snapshots. You type amazon, you get a freshly resumed VM called amazon based on a previously suspended unnamed VM but with a virtual data disk called amazon.vmdk plugged to it where the VM can write permanent changes to be kept after VM shutdown. If you shut the VM down and ask for the amazon VM again, it will be resumed with a totally clean system disk and we want it to have the same amazon.vmdk as its data disk, so it sees the old data. But it cannot see the data immediately - unmount, mount and restart of nemo-desktop are needed. The same with other sites, one VM per site. If any VM goes rogue, the effect can be wiped clean at VM shutdown periodically but the user data is kept for the next iteration.

Quote:
Can you not simply use a terminal and start nemo as a user? Normally that should be possible (I don't know Nemo).
That's what I do at present which sucks, it should be possible for this to happen automatically using vmware's resume script, which scans a directory for scripts that the user has created and put there, and executes them all on resume.

Last edited by Ulysses_; 06-21-2019 at 04:19 PM.
 
Old 06-21-2019, 03:56 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,717

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
When I right-click on my desktop and select "Open as root" I get a dialog to enter my password, then nemo opens as root.
Note: My regular user password, not the root password...I presume it's using sudo somehow.

CentOS 7 with Cinnamon.

Last edited by scasey; 06-21-2019 at 05:27 PM.
 
Old 06-21-2019, 05:23 PM   #8
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by Ulysses_ View Post
The script that will start it is run as root but the actual command that starts it is run as an ordinary user like this: sudo -u user nemo-desktop. But still, this is not the same as typing nemo-desktop on a terminal. Going to a terminal and typing su to become root, and then sudo -u user nemo-desktop does not work for the same reason. Some permission check fails. Wrong environment variables maybe.
.
I don't understand this situation entirely, but my impression is that you need to launch this program with a normal user (no sudo, no su) but with a correct PAM setup. I think the environmental variable you are talking about is PAM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Replace Nautilus With Nemo File Manager On Ubuntu 18.04 Gnome Desktop (Complete Guide) LXer Syndicated Linux News 0 07-03-2018 09:31 PM
[Cinnamon] Can't add app to desktop and strange behaviour when renaming in Nemo altermetax Manjaro 1 06-30-2016 10:46 AM
LXer: Cinnamon Desktop: Breaks with GNOME, finds beefed-up Nemo LXer Syndicated Linux News 0 10-30-2013 07:11 PM
LXer: Cinnamon Desktop: Breaks with GNOME, finds beefed-up Nemo LXer Syndicated Linux News 0 10-29-2013 02:21 PM
replies to Chinaman (and Ranger Nemo) beginnerx Linux - Newbie 5 10-21-2003 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration