Score:0

Custom gdm session logs me out on Ubuntu 18.04

ru flag

I have a requirement where a sandbox user only needs to see a single application without running Gnome or any DE at all (basically a kiosk setup).

I created a new .desktop file in /usr/share/xsessions, which runs a shell script that launches and configures the application. However, shortly afterwards, the whole session is terminated (I am assuming because the batch file ends).

One of the things I tried was adding a /bin/bash at the end of it to keep it running in the background, but that doesn't help.

Looking at this question it seems that the standard way to do it is to put the application call itself into a loop. However, I can't do that because of the nature of this application. I need to launch the application first, and run other commands afterwards before surrendering control to the user.

Here is a simplified version of my script:

google-chrome &
sleep 5
xdotool search --onlyvisible --name chrome windowmove %@ 0 0
/bin/bash # ??? doesn't work
user535733 avatar
cn flag
If you are open to alternative implementations, a sandboxed user kiosk is essentially what the [Ubuntu Frame snap](https://snapcraft.io/install/ubuntu-frame/ubuntu) does. See Ubuntu Frame in action in this [Youtube demo](https://www.youtube.com/watch?v=nhf3sU3JFxI).
ru flag
@user535733 Thanks! This is helpful to know about in general, but not for this specific project because I need to set it up in a way where a special user logs directly into the kiosk mode and not have access to anything else. So if they are another user, they can go into a full Gnome session, but if they are the sandbox user, they must be logged into the other environment.
user535733 avatar
cn flag
The same Canonical engineers have done a couple other Wayland+Kiosk projects that you may be able to adapt to your needs. [Example](https://discourse.ubuntu.com/t/make-a-secure-ubuntu-web-kiosk/13993/)
waltinator avatar
it flag
Read `man nohup`, and try `nohup google-chrome &`
Score:0
ru flag

For anyone looking for this in the future, I solved it by running a loop that checks whether the main app window is still open. This solves both the issue of keeping the session alive as well as logging the user out once they close Chrome.

Replaced the last line with this and it works like a charm:

while xdotool search --onlyvisible --name chrome; do sleep 3s; done

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.