Artix Linux Forum

Init systems => dinit => Topic started by: kiblaster on 11 October 2023, 19:54:32

Title: Issues with turnstile
Post by: kiblaster on 11 October 2023, 19:54:32
turnstiled service is shown fine in dinitctl output but it doesn't spawn any dinit instance, there is no dinit process.
/var/log/turnstiled.log is empty.

I have turnstile-dinit, pambase-turnstile, turnstile and some user services installed.

Also sometimes, like 50% of the times,  it makes the machine hang at boot for 1 maybe 2 minutes with some error:
Title: Re: Issues with turnstile
Post by: kiblaster on 11 October 2023, 20:17:54
On another machine:
I was using this 2 service fine when launching dinit manually before turnstile:
Code: [Select]
type = process
command = picom
logfile = $HOME/.local/share/dinit/picom.log
restart = true

type = process
command = pasystray --notify=all
logfile = $HOME/.local/share/dinit/pasystray.log
restart = true

pasystray log:
Code: [Select]
option parsing failed: Cannot open display:

picom log:
Code: [Select]
[ 10/05/23 20:41:34.074 main FATAL ERROR ] Can't open display.
I use fork with experimental features and crash like 4 times per minute.

/var/log/turnstiled.log just states:
Code: [Select]
[  OK  ] picom
dinit: Service picom process terminated with exit code 1
dinit: Service picom restarting too quickly; stopping.
[STOPPD] picom
[  OK  ] pasystray
dinit: Service pasystray process terminated with exit code 1
dinit: Service pasystray restarting too quickly; stopping.
[STOPPD] pasystray

I have turnstile-dinit, pambase-turnstile, turnstile and some user services installed.
Other services are fine:
Code: [Select]
[[+]     ] boot
[{+}     ] system
[{+}     ] pipewire (pid: 735)
[{+}     ] dbus (pid: 725)
[     {X}] picom (exit status: 1)
[     {X}] pasystray (exit status: 1)
[{+}     ] wireplumber (pid: 737)
[{+}     ] pipewire-pulse (pid: 736)
Title: Re: Issues with turnstile
Post by: negative on 13 October 2023, 03:08:15
running services on turnstile/dinitctl is not exporting user environmment variables. for picom's sake, it at least needs thew variable DISPLAY to be set but its not.
Title: Re: Issues with turnstile
Post by: kiblaster on 14 October 2023, 20:07:57
Can I fix environment variables somehow?

On one machine turnstile doesn't work at all.

I use this workaround that seems perfect, in the autostart:
Code: [Select]
pkill dinit &
[...]
dinit -u &
Title: Re: Issues with turnstile
Post by: negative on 15 October 2023, 04:24:30
i am not sure as of how specific variable are derived in user environment. as a workaround run picom as a script, check if DISPLAY is empty, and if it is then set it to DISPLAY=:0 before running picom. again this is just a workaround and may not work in most cases.

Code: [Select]
pkill dinit &
[...]
dinit -u &

using this will make the usage of turnstile unnecessary as this is basically what turnstile do (somewhat but run with a system-service instead).
Title: Re: Issues with turnstile
Post by: kiblaster on 15 October 2023, 16:12:09
using this will make the usage of turnstile unnecessary as this is basically what turnstile do (somewhat but run with a system-service instead).

I did that because on one device turnstile doesn't work at all.

I can use that to workaround picom and pasystray (instead of using turnstile) on other device too.
Title: Re: Issues with turnstile
Post by: konimex on 19 October 2023, 17:26:56
From your screenshot, you're logging in as root. Please note that user session manager is by default disabled for root user.

I do NOT recommend you to use root for daily use for obvious reasons, but if you insist, you need to enable it manually on /etc/turnstile/turnstiled.conf by changing root_session = no to root_session = yes.
Title: Re: Issues with turnstile
Post by: kiblaster on 19 October 2023, 22:18:56
That was the problem of dinit not starting there.

Still:
Code: [Select]
[     {X}] picom (exit status: 1)
[     {X}] pasystray (exit status: 1)

It is not a server.
Title: Re: Issues with turnstile
Post by: kiblaster on 30 May 2024, 18:43:21
Now "pkill dinit" kills the system init so I use this script (https://codeberg.org/realroot/rootstile/src/branch/main/rootstile.sh).

In case of very slow devices a "sleep 0.5" after may be needed.
Title: Re: Issues with turnstile
Post by: kiblaster on 04 January 2025, 13:24:52
Adding $DISPLAY fixed it: https://forum.artixlinux.org/index.php/topic,6929.msg45684.html#msg45684.