You are not logged in.

#1 2023-08-31 14:44:07

Manix
Member
Registered: 2021-04-17
Posts: 81

[solved]need to understand "default target to boot into"

what exactly is the point of changing the "target to boot into"?
wiki target to boot into

recently installed swaync with its systemd unit, which requires graphical.target
swayrc github

after changing to "graphical.target" as mentioned in the wiki the unit does not start.
I also found out that you can change the target boot for the user, but it doesn't change anything.

I run Hyprland via tty with this command in .zprofile :

if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
  exec Hyprland
fi

for the moment I start the unit via the hyprland config which works, that's why I'm wondering.
thanks for your insights!

Last edited by Manix (2023-09-01 10:26:26)


I don't love rosbeef

Offline

#2 2023-08-31 14:51:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [solved]need to understand "default target to boot into"

Manix wrote:

... swaync with its systemd unit, which requires graphical.target

Well no, not really.  Just the default service file is configured to run only under the graphical.target.

Manix wrote:

after changing to "graphical.target" as mentioned in the wiki the unit does not start.

So is that the problem you really want help with?  If so, you need to post diagnostic information (e.g., errors / logs) about that rather than focusing on another point that you only suspect to be the problem (otherwise this is just an X-Y problem).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-08-31 15:12:41

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

@tribly thank you for your prompt reply.

here's the unit:

[Unit]
Description=Swaync notification daemon
Documentation=https://github.com/ErikReider/SwayNotificationCenter
PartOf=graphical-session.target
After=graphical-session.target
# ConditionEnvironment requires systemd v247 to work correctly
ConditionEnvironment=WAYLAND_DISPLAY

[Service]
Type=dbus
BusName=org.freedesktop.Notifications
ExecStart=/usr/bin/swaync
ExecReload=/usr/bin/swaync-client --reload-config ; /usr/bin/swaync-client --reload-css
Restart=on-failure

[Install]
WantedBy=graphical-session.target

after restart :

 ❯ systemctl status --user swaync.service 
○ swaync.service - Swaync notification daemon
     Loaded: loaded (/usr/lib/systemd/user/swaync.service; enabled; preset: enabled)
     Active: inactive (dead)
       Docs: https://github.com/ErikReider/SwayNotificationCenter
❯ systemctl get-default 
graphical.target
❯ systemctl --user get-default 
default.target

I'm just trying to get this unit to work without going through the hyprland configuration and maybe understanding "default target to boot into".


I don't love rosbeef

Offline

#4 2023-08-31 15:26:53

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: [solved]need to understand "default target to boot into"

What is the session type?

loginctl show-session $XDG_SESSION_ID --value --property=Type

Offline

#5 2023-08-31 15:36:13

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

What is the session type?

 ❯ loginctl show-session $XDG_SESSION_ID --value --property=Type
wayland

I don't love rosbeef

Offline

#6 2023-08-31 16:03:29

loqs
Member
Registered: 2014-03-06
Posts: 18,930

Re: [solved]need to understand "default target to boot into"

What is the status of graphical-session.target for your user?

$ systemctl status --user graphical-session.target

Edit:
If you boot with the kernel parameter systemd.log_level=debug does the extra logging in the journal show why the service is not started?

Last edited by loqs (2023-08-31 16:13:34)

Offline

#7 2023-08-31 16:38:56

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

What is the status of graphical-session.target for your user?

 ❯ systemctl status --user graphical-session.target
○ graphical-session.target - Current graphical user session
     Loaded: loaded (/usr/lib/systemd/user/graphical-session.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)
 ❯ systemctl status --user swaync.service   
○ swaync.service - Swaync notification daemon
     Loaded: loaded (/usr/lib/systemd/user/swaync.service; enabled; preset: enabled)
     Active: inactive (dead)
       Docs: https://github.com/ErikReider/SwayNotificationCenter

Aug 31 18:33:48 archnico systemd[640]: swaync.service: Watching D-Bus name 'org.freedesktop.Notifications'.
Aug 31 18:33:48 archnico systemd[640]: swaync.service: D-Bus name org.freedesktop.Notifications now not owned by anyone.
Aug 31 18:36:04 archnico systemd[640]: swaync.service: Next restart interval calculated as: 100ms

there's a change but I'm not sure what to make of it.


I don't love rosbeef

Offline

#8 2023-08-31 18:00:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,104

Offline

#9 2023-09-01 03:41:03

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

Doesn't work. I already had skip username and getty unit enabled.

❯ cat /etc/systemd/system/getty@tty1.service.d/skip-username.conf 
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- nico' --noclear --skip-login - $TERM
Environment=XDG_SESSION_TYPE=wayland
❯ systemctl status getty@tty1.service 
● getty@tty1.service - Getty on tty1
     Loaded: loaded (/usr/lib/systemd/system/getty@.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/getty@tty1.service.d
             └─skip-username.conf
     Active: active (running) since Fri 2023-09-01 05:29:46 CEST; 1min 24s ago
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 602 (login)
      Tasks: 0 (limit: 38148)
     Memory: 2.9M
        CPU: 23ms
     CGroup: /system.slice/system-getty.slice/getty@tty1.service
             ‣ 602 "login -- nico"

Sep 01 05:29:46 archnico systemd[1]: Started Getty on tty1.
Sep 01 05:29:59 archnico login[602]: gkr-pam: unable to locate daemon control file
Sep 01 05:29:59 archnico login[602]: gkr-pam: stashed password to try later in open session
Sep 01 05:29:59 archnico login[602]: pam_unix(login:session): session opened for user nico(uid=1000) by nico(uid=0)
Sep 01 05:29:59 archnico login[602]: gkr-pam: unlocked login keyring

I don't love rosbeef

Offline

#10 2023-09-01 06:06:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,104

Re: [solved]need to understand "default target to boot into"

https://man.archlinux.org/man/core/syst … User_Units
"BindsTo=graphical-session.target"

The problem is likely that this will fire too early, so the super-elegant solution would be to create a special service that binds to the target and explicitly start that service w/ sway:
https://github.com/i3/i3/issues/5186#is … 1405779520

Offline

#11 2023-09-01 07:54:10

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

so it's not because graphical.target? (get-default)

if i have to create a unit specifically for this service, I prefer to start it via the Hyprland config for the time being.

the psd.service unit works correctly, maybe modify the swaync unit directly?

[Unit]
Description=Profile-sync-daemon
Documentation=man:psd(1) man:profile-sync-daemon(1)
Documentation=https://wiki.archlinux.org/index.php/Profile-sync-daemon
Wants=psd-resync.service
RequiresMountsFor=/home/
After=winbindd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/profile-sync-daemon startup
ExecStop=/usr/bin/profile-sync-daemon unsync
Environment=LAUNCHED_BY_SYSTEMD=1

[Install]
WantedBy=default.target

I don't love rosbeef

Offline

#12 2023-09-01 09:15:18

snakeroot
Member
Registered: 2012-10-06
Posts: 176

Re: [solved]need to understand "default target to boot into"

Graphical.target and graphical-session.target are two different animals. The latter, which is the one relevant here, is intended to make certain that services which only make sense in the context of a GUI (such as, for example, notification popups) only run while a GUI session is in operation and exit when it isn't. The former, which swaync service expressly *doesn't* have as a requisite (see swaync issue #51) relates to graphical logins like sddm or the like which are not recommended for sway.

AFAICT, the swaync service is designed to be activated via dbus not directly via target (or otherwise). It looks like there's some dbus issue with org.freedesktop.Notifications which you may wish to look into.

Offline

#13 2023-09-01 10:25:36

Manix
Member
Registered: 2021-04-17
Posts: 81

Re: [solved]need to understand "default target to boot into"

Graphical.target and graphical-session.target are two different animals. The latter, which is the one relevant here, is intended to make certain that services which only make sense in the context of a GUI (such as, for example, notification popups) only run while a GUI session is in operation and exit when it isn't. The former, which swaync service expressly *doesn't* have as a requisite (see swaync issue #51) relates to graphical logins like sddm or the like which are not recommended for sway.

Okay, it's less confusing now.

Hyprland doesn't have a "*-session.target" unit, unlike sway. maybe that explains it.
https://wiki.archlinux.org/title/Sway#M … th_systemd

The best thing would be to install a display manager...

AFAICT, the swaync service is designed to be activated via dbus not directly via target (or otherwise). It looks like there's some dbus issue with org.freedesktop.Notifications which you may wish to look into.

I'm not going to dwell on it too much, the unit launch is working correctly in the Hyprland configuration at the moment. If anything changes, I'll come back here!
thanks


I don't love rosbeef

Offline

Board footer

Powered by FluxBB