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? |
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 |
Quote:
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. |
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? |
Quote:
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). |
Quote:
Quote:
Quote:
Quote:
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:
|
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. |
Quote:
|
All times are GMT -5. The time now is 06:04 PM. |