Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TheGreenAirplane opened this issue Mar 12, 2024 · 6 comments

Comments

@TheGreenAirplane
Copy link

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
Copy link
Collaborator

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

@TheGreenAirplane
Copy link
Author

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
Copy link
Collaborator

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
Copy link

J-Cake commented Apr 14, 2024

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

This worked for me. Thanks!

@joggee-fr
Copy link
Collaborator

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

@Terramoto
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants