Artix Linux Forum

Init systems => dinit => Topic started by: n00b on 31 December 2024, 03:16:02

Title: dinit for volumeicon?
Post by: n00b on 31 December 2024, 03:16:02
https://gitea.artixlinux.org/packages/volumeicon

should it have a dinit?

Code: [Select]
/etc/dinit.d/user/$ sudo touch volumeicon 
sudo nano volumeicon

added

Code: [Select]
type            = process
command         = /usr/bin/volumeicon

Code: [Select]
dinitctl enable volumeicon
Service 'volumeicon' has been enabled.
Service 'volumeicon' started.

Code: [Select]
dinitctl list
[[+]     ] boot
[{+}     ] system
[{+}     ] dbus (pid: 886)
[{+}     ] pipewire (pid: 890)
[{+}     ] pipewire-pulse (pid: 892)
[{+}     ] wireplumber (pid: 891)
[     {X}] volumeicon (exit status: 1)

so that didn't work.

1) why not?
2) should volumeicon have a dinit?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 31 December 2024, 08:44:21
If it crashes a service can be useful.
Otherwise you may just launch it.

Add a log in the service to see what's wrong.
Code: [Select]
logfile = $HOME/.local/state/dinit/volumeicon.log

You need to create the log folder if it does not exist.
Title: Re: dinit for volumeicon?
Post by: n00b on 31 December 2024, 22:26:57
$HOME/.local/state/dinit/volumeicon.log

Code: [Select]
Cannot open display: 
Cannot open display:
Cannot open display:
Cannot open display:

The only reference i found is... ha ha https://forum.artixlinux.org/index.php/topic,6023.0.html

wat do?

found another

https://forum.artixlinux.org/index.php/topic,5781.0.html
Title: Re: dinit for volumeicon?
Post by: kiblaster on 01 January 2025, 11:20:52
Are you using startx to launch the GUI?

As explained in the reference https://forum.artixlinux.org/index.php/topic,6023.msg41981.html#msg41981 you can use that script instead of turnstile.
Title: Re: dinit for volumeicon?
Post by: n00b on 01 January 2025, 16:20:23
Are you using startx to launch the GUI?
what gui? the applet shows in systray when it is running?
EDIT
moksha? I am using tuigreet. But I don't really know how moksha starts
/EDIT
As explained in the reference https://forum.artixlinux.org/index.php/topic,6023.msg41981.html#msg41981 you can use that script instead of turnstile.
are you saying I should not or cannot use turnstile?

Sorry for my ignorance
Title: Re: dinit for volumeicon?
Post by: kiblaster on 01 January 2025, 19:32:51
So moksha is the GUI.
There is a bug with startx https://forum.artixlinux.org/index.php/topic,6929.msg42122.html#msg42122 maybe tuigreet uses it.

If you need services that use the "display" at the moment you cannot use turnstile with startx.

Code: [Select]
I can't reproduce it by logging in through lxdm or lightdm (logging into openbox-session with picom enabled)
Thus it should work with those.
Title: Re: dinit for volumeicon?
Post by: n00b on 02 January 2025, 03:07:36
I know nothing

https://wiki.artixlinux.org/Site/MokshaDesktopForArtix#Display_Manager
tuigreet uses greetd which also has a greetd-dinit?

and sudo dinitctl list shows greetd

Could I run volumeicon like after greetd or something? Or is there nothing for it?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 02 January 2025, 12:55:36
How do you autostart things in moksha?
https://bodhilinux.boards.net/thread/946/autostart-solved
Title: Re: dinit for volumeicon?
Post by: n00b on 02 January 2025, 16:51:32
How do you autostart things in moksha?
https://bodhilinux.boards.net/thread/946/autostart-solved
thank you for your reply.
I am aware how I could have this work, and thank you for the reminder.

I am asking how does one make it work with dinit? Or turnstile?

And this leads me to ask stupid things like if greetd should be launching dinit user services and dinit starts everything?

I guess that is not supported?? and moksha currently works a certain way  and upgrades will break that setup?

Does @davmac  know about the startx turnstile issue?

Should init handle login? Is this the path to pottering like madness?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 02 January 2025, 19:53:08
Turnstile is developed by Chimera Linux: https://github.com/chimera-linux/turnstile.
Title: Re: dinit for volumeicon?
Post by: n00b on 02 January 2025, 23:54:01
lol
#chimera-linux
q66 (Ops) [email protected]> n00b: looks like an artix problem and my level of care about artix problems is very low so i will not check deeper

apparently Chimera Linux says that artix doesn't have graphical service support in turnstile.

So this answers why anything with graphics will be a problem, but works in Chimera

Thanks kiblaster

should I this to the wiki?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 03 January 2025, 14:21:00
A warning about startx and services that need the DISPLAY var could be added in the wiki.

I was looking the dinit-service man page maybe adding to the service
Code: [Select]
env-file = $HOME/.config/dinit.d/environment
will work.

And of course you need to make the file.
Code: [Select]
 cat .config/dinit.d/environment 
DISPLAY=:0
Title: Re: dinit for volumeicon?
Post by: Artist on 03 January 2025, 15:17:11
To 'integrate' a service process so it can use the display of a existing session, this simple solution can be used:

    https://forum.artixlinux.org/index.php/topic,4174.msg26837.html#msg26837

artist
Title: Re: dinit for volumeicon?
Post by: kiblaster on 04 January 2025, 13:07:10
I tested turnstile again and it does not well.
When I log out the old (user) dinit process it's there so no user services.
After disabling turnstile something kept spawning it so I rebooted.

I do not have elogind so I set in /etc/turnstile/turnstiled.conf
Code: [Select]
export_dbus_address = yes
Thus I think that that service does not have any sense here.

"env-file" works but "~" or "$HOME" do not work there while at least $HOME works in "command".

Since the file is near the service I can just use:
Code: [Select]
type = process
command = picom
logfile = $HOME/.local/state/dinit/picom.log
env-file = environment
restart = true

I have no dbus address set without turnstile but all works always.
Title: Re: dinit for volumeicon?
Post by: n00b on 04 January 2025, 18:03:44
@kiblaster 

Quote
I do not have elogind so I set in /etc/turnstile/turnstiled.conf

I think
Code: [Select]
export_dbus_address = yes
is there by default?

before I try and add this volumeicon service
Code: [Select]
dinitctl list
[[+]     ] boot
[{+}     ] system
[{+}     ] dbus (pid: 998)
[{+}     ] pipewire (pid: 1002)
[{+}     ] pipewire-pulse (pid: 1004)
[{+}     ] wireplumber (pid: 1003)

service file
Code: ($HOME/.local/state/dinit/volumeicon) [Select]
type = process
command = /usr/bin/volumeicon
logfile = $HOME/.local/state/dinit/volumeicon.log
env-file = enviroment
restart = true

Code: [Select]
dinitctl enable volumeicon
dinitctl: error loading service (or dependency of service).
dinitctl: try 'dinitcheck <service-name>' or check log for more information.

dinitcheck volumeicon
Checking service: volumeicon...
Service 'volumeicon': could not load environment file: No such file or directory
dinitcheck: Warning: Variable substitution performed by dinitcheck for file paths may not match dinit daemon (environment may differ); use --online to avoid this warning
Performing secondary checks...
Secondary checks complete.
One or more errors/warnings issued.

I cannot find a discussion of --online


Code: [Select]
cat ~/.config/dinit.d/enviroment
DISPLAY=:0
Title: Re: dinit for volumeicon?
Post by: kiblaster on 04 January 2025, 20:01:38
Is  the service in ~/.config/dinit.d/?

You can try with the absolute path:
Code: [Select]
env-file = /home/n00b/.config/dinit.d/environment

Title: Re: dinit for volumeicon?
Post by: n00b on 04 January 2025, 20:44:50
Quote
Is  the service in ~/.config/dinit.d/?
Code: [Select]
$:~/.config/dinit.d$ ls
boot.d  enviroment

So yes?

/home/USER/.config/dinit.d/enviroment worked

Code: [Select]
$: dinitctl list
[[+]     ] boot
[{+}     ] system
[{+}     ] dbus (pid: 875)
[{+}     ] pipewire (pid: 879)
[{+}     ] pipewire-pulse (pid: 881)
[{+}     ] wireplumber (pid: 880)
[{+}     ] volumeicon (pid: 16945)

Thank you @kiblaster
I will edit the wiki.

The unurgent question remains, should volumeicon have a dinit?
Is it better in Moksha startup?
How does one make that call?
Finally,
Quote
If you need services that use the "display" at the moment you cannot use turnstile with startx.
I think this is no longer true and "display" needs have a simple fix, yes?
Title: Re: dinit for volumeicon?
Post by: n00b on 04 January 2025, 21:46:36
https://wiki.artixlinux.org/Main/Dinit#t.23userservices_display_User_Services_needing_.22Display.22

This ok?
Title: Re: dinit for volumeicon?
Post by: n00b on 05 January 2025, 01:07:53
I guess the problem is using the user dir in a user services file makes it user specific, yes?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 05 January 2025, 08:41:22
I mean is the volumeicon service file in the "~/.config/dinit.d/ folder"?
Near environment file otherwise it won't work of course.
I see that it is not because because of the wiki.
Instead of editing system file in /etc copy the service in ~/.config/dinit.d/.
Or in this case create it directly there.
So far services in the repo do not have DISPLAY at some point this may be included and therefore environment could be placed somewhere in /etc and thus you can refer to it using the absolute path /etc/path/file.

Note I had a typo and I always wrote environment wrong now edited.
Title: Re: dinit for volumeicon?
Post by: n00b on 05 January 2025, 22:40:26
I mean is the volumeicon service file in the "~/.config/dinit.d/ folder"?
Near environment file otherwise it won't work of course.
Of course. derp
I see that it is not because because of the wiki.
Instead of editing system file in /etc copy the service in ~/.config/dinit.d/.
Or in this case create it directly there.
done... and when the service file is placed in ~/.config/dinit.d/
Code: [Select]
env-file = environment
works perfectly.
So far services in the repo do not have DISPLAY at some point this may be included and therefore environment could be placed somewhere in /etc and thus you can refer to it using the absolute path /etc/path/file.

First, thank you for your patience with me.

It occurs to me  that dinit services will not typically need DISPLAY,  Is that true?
Perhaps only turnstile services would, does that make sense?

Perhaps an addon to support DISPLAY in turnstile? But I know nothing.

Are these reasonable lessons I could take away from this?
1) It seems the sound stuff goes in turnstile, as it is DE independent.

2) volumeicon should start with Moksha, as it is DE dependent.

3) But the blueman-applet, which I need started, probably is DE independent, so could use a turnstile service? And might be user independent?

Thank you again.
Title: Re: dinit for volumeicon?
Post by: kiblaster on 06 January 2025, 08:33:38
Services that use the DISPLAY will need it.
Something that runs in the background does not.
(This happens in turnstile because DISPLAY var is not set).

You can start dinit services in you DE autostart so that they will be  DE independent.
Code: [Select]
dinitctl --user start volumeicon
Title: Re: dinit for volumeicon?
Post by: n00b on 07 January 2025, 22:10:52

You can start dinit services in you DE autostart so that they will be  DE independent.
Code: [Select]
dinitctl --user start volumeicon

I was thinking the init should start the DE. But I am often wrong.
How do you pick who starts who?
Title: Re: dinit for volumeicon?
Post by: kiblaster on 08 January 2025, 17:32:08
I do not think that the DE can start the init.
What's the problem?