Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
(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
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.
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?
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).
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.