Anyone successfully made a dinit service script for the ly dm, theres no package and i cant manage
Creating these these scripts for our init's is on my todo list, but not at the top.
You'll find Ly's own script for s6 here: https://github.com/fairyglade/ly/tree/master/res/ly-s6
artist
FYI: there is a very good alternative for Ly as TUI display manager; Tuigreet.
This comes as packages greetd-tuigreet, and depends on packages greetd and greetd-<init> which are all in the Artix repos.
Tuigreet is a solid program with hardly ever any open issues, and well documented.
One advantage of Tuigreet is that the actual greeter/login process runs as an unprivileged greeter user.
artist
If you install the ly Artix package, then it will make sure the ly-dm binary is installed on the system.
There isn't any Artix package yet for ly-dinit, but upstream's dinit service script that you can slightly modify is located here
https://github.com/fairyglade/ly/blob/master/res/ly-dinit
You'll change line 4 in upstream to read
command = /usr/bin/ly-dm
I used ly before and for the sake of it I decided to try it out again, but failed.
I did what you described with the script in artix ly-dinit package, changing the command parameter to /usr/bin/ly-dm , but ly does not start at all.
ly service should be enabled like a normal system service with sudo dinitctl enable, right?
Try:
- dinitctl start ly
- /usr/bin/ly-dm
and see if this produces any errors.
And provide details on how ly has been configured.
artist
Oh maybe I found why
From the ly github page https://github.com/fairyglade/ly?tab=readme-ov-file#dinit
dinit
# zig build installdinit
# dinitctl enable ly
In addition to the steps above, you will also have to keep a TTY free within /etc/dinit.d/config/console.conf.
To do that, change ACTIVE_CONSOLES so that the tty that ly should use in /etc/ly/config.ini is free.
To do that, change ACTIVE_CONSOLES so that the tty that ly should use in /etc/ly/config.ini is free.
How do I do this?
Ok I have this file /etc/dinit.d/config/console.conf.
# Active consoles
# Currently available: /dev/tty1 until /dev/tty6
ACTIVE_CONSOLES="/dev/tty[1-6]"
Do I just edit like this: /dev/tty[1-5] ?
In file /etc/ly/config.ini there is a section:
# TTY in use
tty = 2
where tty can be modified to ie. 7
artist
Okay this time I did not modify /etc/dinit/ly and /etc/dinit.d/config/console.conf.
I just edited /etc/ly/config.ini tty = 7, and started ly (as root).
I get this error
# dinitctl status ly
Service: ly
State: STOPPED (could not be launched)
Stage: executing command
Error: Permission denied
I also made sure that my .xinitrc is executable as told in that github page
Edit: the file I edited was /etc/ly/config.ini, my bad
I hope you mean that you left the "command = /usr/bin/ly-dm" line intact?
That probably means the command executable (/usr/bin/ly-dm) is not marked executable, for some reason. Seems strange.
What does "ls -l /usr/bin/ly-dm" report?
cat /etc/dinit.d/ly
type = process
restart = true
smooth-recovery = true
command = /usr/bin/$EXE_NAME
depends-on = loginready
termsignal = HUP
# ly needs access to the console while loginready already occupies it
options = shares-console
That above is the default service file.
I did modify "/usr/bin/$EXE_NAME'" with "/usr/bin/ly-dm" before, now I have the default one.
ls -l /usr/bin/ly-dm
-rwxr-xr-x 1 root root 586720 24 ago 16.52 /usr/bin/ly-dm
That is the problem, it needs to be modified. Without the "EXE_NAME" environment variable being set to anything, that just comes as "/usr/bin/". That's why you get "permission denied" - you've told Dinit to execute a directory.
Most likely that original file is used as a template in the ly build, i.e. it will replace $EXE_NAME with the actual executable name. (I haven't checked this but it's highly likely).
I changed back to "/usr/bin/ly-dm". But I have faced some issues:
no matter if I set "tty = 7" in /etc/ly/config.ini, ly always starts on tty 1.
WIth the default /etc/dinit.d/config/console.conf (tty 1 to 6) trying to start ly, doesn't start it but it gives a bunch of error on said tty ( tty 1), even though in dinitctl status the service's state is STARTED.
Second try, I modified /etc/dinit.d/config/console.conf (tty 2 to 6), so ly actually starts and shows up on tty 1, but when I try to login it gives this error: /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
Third try, I created this file
cat /etc/X11/Xwrapper.config
allowed_users = anybody
Now I don't get the error above, but Xorg crashes with this error (this happens regardless if I set "tty = 1" or "tty = 7" in /etc/ly/config.ini, having set dinit tty between 2 and 6) :
[ 1892.706] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[ 1892.706] (EE)
Fatal server error:
[ 1892.707] (EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)
[ 1892.707] (EE)
[ 1892.707] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 1892.707] (EE) Please also check the log file at "/home/prova/.local/share/xorg/Xorg.1.log" for additional information.
[ 1892.707] (EE)
[ 1892.707] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[ 1892.707] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[ 1892.707] (EE) Server terminated with error (1). Closing log file.
That's weird, as I can normally start xorg with startx or xinit.
anyone able to get ly to run properly? i have already changed $EXE_NAME to ly-dm, tty is set to 2 (dunno if console_dev nothing changed if i set this anyways). when booting system, im getting zig/ly related errors and tty1 and nothing else on other tty[2-6] or even tty7 if i set it in config. running ly-dm directly from terminal, its main interface appears, but nothing when started from boot through dinit.
Please provide the error's you see and also from any log file.
It might not make a difference, but you can test ly-git from the omniverse repository.
FYI: there is a very good alternative for Ly as TUI display manager; Tuigreet.
This comes as packages greetd-tuigreet, and depends on packages greetd and greetd-<init> which are all in the Artix repos.
Tuigreet is a solid program with hardly ever any open issues, and well documented.
One advantage of Tuigreet is that the actual greeter/login process runs as an unprivileged greeter user.
artist
im only getting this message on tty1, pressing enter will should normal artix login prompt. no ly interface appears on any other tty. moving default tty in /etc/ly/config to 2 or 7 (not use by console) still no ly. try ly from "world" repo and ly-git from "omniverse" still the same
One required variable is probably missing. One of the downsides of Ly is that the errors are not helpful.
So, carefullly compare your setup for Ly to what is required. Note that the agetty related instructions most probably also apply for dinit.
artix
ok, managed to get LY working by replacing "command = /usr/bin/$EXE_NAME" to point to a custom shell sript that run "/usr/bin/agetty -nl /usr/bin/ly-dm 38400 linux"
wierd to have a dinit script included which is incomplete. even the upstream ly repo uses the same incomplete dinit script, at least it should follow how ly was implemented in runit for example.
@negative I got same exact issue as you, tried everything and changing to "/usr/bin/agetty -nl /usr/bin/ly-dm 38400 linux", nothing helped. I'm trying to get ly to start in tty2 only, but for now I only experimented with tty7. tty7 is just blank page with blinking cursor no matter what I change.
I'm afraid of breaking stuff in `/etc/dinit.d/config/console.conf`, can I change it to `ACTIVE_CONSOLES="/dev/tty[1,3-6]"`to free tty2?
@negative Could you share all the files that needed for ly? Like git repo or something else if you got it, been stuck on this for past two days. Might just give up and try "Tuigreet" like
@Artist suggested.
related: https://github.com/davmac314/dinit/discussions/440
im just using the modified launcher from ly-runit. copy this code into your executable path (e.g. /usr/bin/). Make it executable.
#!/bin/sh
## Get the tty from the conf file
CONFTTY=$(cat /etc/ly/config.ini | sed -n 's/^tty.*=[^1-9]*// p')
## The execution vars
# If CONFTTY is empty then default to 2
TTY="tty${CONFTTY:-2}"
TERM_NAME=linux
BAUD=38400
[ -r conf ] && . ./conf
if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi
#setsid
exec ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly-dm "${TTY}" "${BAUD_RATE}" "${TERM_NAME}"
#exec setsid /usr/bin/ly-dm
then modify /etc/dinit/ly. change "command = $EXE_NAME" to "command = <path_to_script_from_above>".
enable service. this should be enough to make ly work.
@negative Thank you! I managed to get it working on tty7, what did you set "ACTIVE_CONSOLES" to make it work with tty2?
Never mind, found this: https://manpages.debian.org/testing/console-setup/console-setup.5.en.html#ACTIVE_CONSOLES and https://askubuntu.com/a/817859
It is a wild card so setting it to
/dev/tty[1,3-6]
should work.
Spoke too soon, after reboot it crashed Hyprland that autostarts on tty1 and switches to tty2 with ly...
I'm giving up, not worth it with my setup.
Did you disable the agetty service(s) for the tty(s) you want to use? That is required.
Or indeed try Greetd with Tuigreet.
artist
I think tuigreet needs it's own wiki section.
disable tty2,
# sudo dinitctl disable tty2
i had mine on default, so it starts at tty7 which console and default agetty is not
Trying to figure out much the same.
My "/etc/ly/config.ini" is set to start in tty7;
I have additionally changed "/etc/dinit.d/ly" to include the following:
inittab-id = 7
inittab-line = tty7
I've also played around with switching the "options" variable between "starts-on-console" and the default "shares-console".
I've used the fix provided in this thread to boot into tty7 with agetty.
My result is that the I do, indeed, boot with tty7 open, however ly is open in tty1 at boot; and is fighting for control over the terminal with the default login script. I'm lost on how to specify it to actually start into tty7.
Does one need to actually compile it from source, then? Or how did you manage to get it running there,
@negative and
@danielwerg ?
did you disable the relevant agetty service as instructed in the ly reedme?
artist
There never was an agetty service for tty7, only 1 through 6.
Since this keeps coming up (here and elsewhere), I've had a bit of a look at the state of things. Let me weigh in:
- The dinit service file distributed with ly (both upstream and in Artix) isn't correct. The upstream would possibly work if you wanted to run ly on tty1.
- The instructions in the ly readme aren't really correct, either
- As far as I can tell (the documentation for ly isn't great), the tty setting in /etc/ly/config.ini is to tell ly which tty it is (already) running on, not to force it to run on a particular tty
- To run ly with dinit on a particular tty, the easiest solution is to run it via a getty program (eg agetty). That's what the script posted by negative above does. You could (probably) also just edit the service file to run the command directly (something like "/usr/bin/agetty -nl /usr/bin/ly-dm tty7 38400 linux" - replace tty7 with the tty you want to actually run on, and make sure that there's nothing else trying to run on that tty - see instructions elsewhere in thread, i.e. edit /etc/dinit.d/config/console.conf).
- If you're happy with it running it on tty1, you could possibly run without using getty and just use the shares-console option instead. That option is already in the Artix ly-dm service description. The reason this works is that it runs the service on the same console that dinit itself is running on, and that's normally tty1. You still need to prevent the regular getty from running on tty1 in this case.
I hope that clears things up.