cage-kiosk / cage

A Wayland kiosk
https://www.hjdskes.nl/projects/cage
MIT License
1.16k stars 76 forks source link

Failed to enable unit: Cannot alias cage@tty.service as display-manager.service #322

Open TheGreenAirplane opened 6 months ago

TheGreenAirplane commented 6 months ago

Hello, I am trying to set up a kiosk machine using Cage. I'm running Debian 12 (Bookworm). I have installed cage via apt, and I've followed the instructions here https://github.com/cage-kiosk/cage/wiki/Starting-Cage-on-boot-with-systemd to the t. All I've changed was the username, and the app to be executed, which in my case looks like this:

ExecStart=/usr/bin/cage firefox http://localhost:5000 --kiosk

When I got to the third step, I typed in sudo systemctl enable cage@tty1.service

and got back the following message (in bold maroon): Failed to enable unit: Cannot alias cage@tty.sercie as display-manager.service.

Can you please help? I'm very new to Linux, I have no idea what I'm doing wrong.

joggee-fr commented 6 months ago

You may remove the Alias= line in unit file if it causes error in your case.

TheGreenAirplane commented 6 months ago

Thanks. That seems to have helped. I am now able to enable the service. When I reboot, I do indeed get the cage with just Firefox. Although I'm not entirely sure that's what helped.

I've used systemctl to look at the cage unit, this is what I got: image

Thing is, I never manually enabled the one running on tty7. I have probably enabled the one on "tty" and "ty1", through typo's as I was flailing around like a fish out of water. (how can I get rid of them?)

So how did the one at tty7 get started? And why didn't it work from the beginning? I know that's the one doing the magic, because when I disable it through ssh and then restart the machine, I get the normal desktop, and when I enable it again and reboot I get the kiosk.

I also changed the path to my application from firefox to /usr/bin/firefox. Maybe that made it run correctly and made the kiosk appear?

One more thing, when I boot in the kiosk mode, at certain point the original display manager (login screen) appears for about a second or 2. Is it possible to get rid of this, so the user doesn't see it during reboot? The display manager is called kdm3.

joggee-fr commented 6 months ago

The systemd unit file proposed in the wiki has DefaultInstance=tty7, it may explain the service you observe. Just disable the service running the kdm3 display manager if you don't want it.

J-Cake commented 5 months ago

You may remove the Alias= line in unit file if it causes error in your case.

This worked for me. Thanks!

joggee-fr commented 5 months ago

@TheGreenAirplane, please consider mark this issue as complete if everything is OK for you now.

Terramoto commented 5 months ago

Hello, I am trying to set up a kiosk machine using Cage. I'm running Debian 12 (Bookworm). I have installed cage via apt, and I've followed the instructions here https://github.com/cage-kiosk/cage/wiki/Starting-Cage-on-boot-with-systemd to the t. All I've changed was the username, and the app to be executed, which in my case looks like this:

ExecStart=/usr/bin/cage firefox http://localhost:5000 --kiosk

When I got to the third step, I typed in sudo systemctl enable cage@tty1.service

and got back the following message (in bold maroon): Failed to enable unit: Cannot alias cage@tty.sercie as display-manager.service.

Can you please help? I'm very new to Linux, I have no idea what I'm doing wrong.

The service is failing because your argument is being passed to cage, you would need something like: ExecStart=/usr/bin/cage firefox http://localhost:5000 -- --kiosk

Swizzler121 commented 1 month ago

Running into a similar issue, got this error, removed alias as suggested, but ever since doing that now after reboot I just get a single _ on the monitor and no display. File is exactly as shown (running chromium instead of kde widgets) followed the guide as shown. created the cage user with useradd cage -m also tried re-setting up with the sudoer user I was using to configure the machine, still no luck.

EDIT: Nevermind, figured it out -- program I was starting needed xwayland to work. I would recommend adding a section to the setup guide to test the execution line in the terminal before creating the systemd unit, as this would expose errors in the command you're trying to run. I am running into another issue, after enabling the systemd unit you are no longer able to switch to another terminal using ctrl+alt+(1-7) is there a way to re-enable this feature, as I used it for maintenance of the signage in my previous setup.

J-Cake commented 1 month ago

@Swizzler121 I've had far less issues on Arch than Debian-based distros. Perhaps that's some low-hanging fruit to try if you're really stuck.