Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
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.
whatever desktop you're going to be using, look into its mechanism it uses to issue the commands, circumvent that with a script that checks for more than one user first, then if yes issue a separate message dialog box with whatever you want it to say, and from that you can disallow such commands to shut down, or reboot, else one user, then have that script then issue the command given. that is what I'd do.
find where the Desktop is calling to when one uses the menu to reboot, shut down, replace within that your script executable,
Code:
#!/bin/sh
howmany=$(who | awk '{print $1}' | wc -l)
if [[ "$howmany" -eq '1' ]]
then
"call the script that was already being called here"
else
'issue another message back to user, others are
still lodged in, sign out of your account instead. blah blah blah..'
fi
[userx@manjaroieo ~]$ reboot
User root is logged in on tty4.
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl reboot -i'.
seems to point to systemd inhibitors.
maybe you should check those out.
I looked at inhibitors. Doesn't satisfy the goal. One, inhibitors are command line only. As I shared previously, users are GUI oriented. Pointy-clicky. They need to see why their power down or reboot effort aborted. Two, systemd-inhibit does not abort processes but only stalls them. I want the power down or reboot to abort.
One of the speed bumps of the Linux desktop is the overwhelming focus on using the terminal. Developers do not grasp how the majority of users are GUI oriented and the entire concept of the terminal is foreign. I have been using Linux based systems for 16 years and I would struggle deeply without a terminal. But I see how non technical users handle computers every day. Even at work computer savvy co-workers are GUI oriented. When I open a terminal and start cranking out commands or using standard tools such as sed or grep, the co-workers grow eerily quiet and kind of step back a half step.
I looked at molly-guard but that too is command line only. Mostly focused on preventing unwanted reboots and shut downs when using SSH. All feedback is command line.
Summary: I cannot use a command line option. My solution must be GUI.
I am comfortable stating that polkit is the answer. I just haven't figured out the nuances. I will start a new thread for that.
16yrs under your belt, what desktop will you be using?
this is it, yes?
Ubuntu MATE 16.04 and the LightDM login manager.
Problem, anyone can reboot, shut down the system if more than one user is still logged in to same said system.
solution needed, circumvent the shut down, reboot event, to allow only login out of user account if more than one user is logged into same said system. Needs to be GUI driven.
Developers do not grasp how the majority of users are GUI oriented and the entire concept of the terminal is foreign.
I'm not sure I'd agree with that. I'd suggest that the majority of Linux users are more than familiar with the terminal and CLI, 'tho I don't have any statistics to support my opinion. (Which is not to disagree with your particular challenge at the moment)
I've got 19 years in *nix administration and support, and am only beginning to "learn" the nuances of desktop environments...when I get stuck, I just open a terminal window...
well that logout button on mate panel is hard wired into the code, it'd take a git pull and mod panel-action-button.c and whatever else, as well as downloading everything needed to compile it and test it, get it to work then install in onto your system blacklist any updates for it, then you're in like flint.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.