2

I am running a program on a public computer and I want to avoid that other people may shut down it.
I do have the root password.
How to skip the shutdown using some commands?

I have zero idea of this. But there must be a way of doing this.

2
  • You want to stop other users sitting down from shutting down the whole computer (like the kiosk mode duenni suggests)? Or just stop users from killing your running program? Or you want to "catch" a shutdown command and "skip" it using some commands?
    – Xen2050
    Apr 1, 2016 at 11:27
  • tell me all... :) Apr 1, 2016 at 18:21

2 Answers 2

1

While @duenni provided a valid answer, you can easily roll your own implementation because basically you need these things:

  • Tweak X Window server settings to stop responding to the Ctrl+Alt+Backspace combo which shuts that server down. I think recent versions of X.Org come with this key combo disabled anyway.

  • Inhibit handling of the Ctrl+Alt+Del combo.

    This depends on which init "superprocess" is installed.

    With the clasic /sbin/init from the sysvinit package this is configured in the /etc/inittab configuration file.

    With systemd, which is the default init system in Debian 8 "Jessie", this should supposedly be done by issuing the

    # systemctl mask ctrl-alt-delete.target
    

    command.

  • Disable all "virtual terminals" except the one which is running the X server.

    Typically a GNU/Linux system has a bunch (usually 1-4) VTs configured for "textual" logins, and then starts an X server on another VT (usually 7). The user is able to switch between them using the Ctrl+Alt+F<n> combos.

    In "the kiosk mode" it makes sense to only have a single VT active and run the X server on it.

    Disabling VTs is, again, depends on the init system — tweaking /etc/inittab for the sysvinit and messing with appropriate .target files for systemd.

  • Run a specialized Window Manager (WM) which runs with the credentials of the specified user on your X server.

    Typically, a special piece of software called "Desktop Manager" (DM) is run on the X server. The task of that piece of software is to have a user provide their credentials and then start an "X session" configured for that system (or system-wide) — their preferred Window Manager (WM) or desktop environment (such as KDE, GNOME, XFCE etc). There exists different implementations of DMs: XDM, GDM, lightdm, slime — to name a few.

    An alternative approach, ideally suitable for the "kiosk mode" is to directly run some piece of software on the X server — as if a user has logged in. Debian has such special DM, called nodm packaged. It's configured to run with the credentials of the specified user, run the specified software (such as a web browser or some dashboard etc) and restart itself if that program exists for some reason. That is, it's in "always on" mode.

  • if you are about running a browser on your box, chromium might be a good pick as it provides special configuration knobs to run it in "kiosk mode": mdash see this for one example.

I'm sure this can get your going.

Googling is also your friend as these solutions are already implemented and documented by lots of folks.

1

What you're looking for is called kiosk mode. There are various methods for achieving this. This also depends on your windowmanager, for example XFCE has a build-in kiosk-mode.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .