Skip to main content
Topic: ly dm dinit scripts (Read 773 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

ly dm dinit scripts

Anyone successfully made a dinit service script for the ly dm, theres no package and i cant manage


Re: ly dm dinit scripts

Reply #2
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

Re: ly dm dinit scripts

Reply #3
Anyone successfully made a dinit service script for the ly dm, theres no package and i cant manage

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
Code: [Select]
command         = /usr/bin/ly-dm


Re: ly dm dinit scripts

Reply #4
Anyone successfully made a dinit service script for the ly dm, theres no package and i cant manage

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
Code: [Select]
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?

Re: ly dm dinit scripts

Reply #5
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

Re: ly dm dinit scripts

Reply #6
Oh maybe I found why
From the ly github page https://github.com/fairyglade/ly?tab=readme-ov-file#dinit

Code: [Select]
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.

Code: [Select]

# 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] ?

Re: ly dm dinit scripts

Reply #7
In file /etc/ly/config.ini there is a section:

# TTY in use
tty = 2

where tty can be modified to ie. 7

artist

Re: ly dm dinit scripts

Reply #8
 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
Code: [Select]
# 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

Re: ly dm dinit scripts

Reply #9
Okay this time  I did not modify /etc/dinit/ly

I hope you mean that you left the "command = /usr/bin/ly-dm" line intact?


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
Code: [Select]
# dinitctl status ly
Service: ly
    State: STOPPED (could not be launched)
        Stage: executing command
        Error: Permission denied

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?


Re: ly dm dinit scripts

Reply #10
Code: [Select]

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.

Code: [Select]

 ls -l /usr/bin/ly-dm
-rwxr-xr-x 1 root root 586720 24 ago 16.52 /usr/bin/ly-dm


Re: ly dm dinit scripts

Reply #11
I did modify "/usr/bin/$EXE_NAME'" with "/usr/bin/ly-dm" before, now I have the default one.

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).

 

Re: ly dm dinit scripts

Reply #12
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
Code: [Select]
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) :

Code: [Select]
[  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.