Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Wayland - Start on boot? (OpenRC, Weston)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
clin
n00b
n00b


Joined: 31 Mar 2018
Posts: 2

PostPosted: Sat Mar 31, 2018 7:55 am    Post subject: [Solved] Wayland - Start on boot? (OpenRC, Weston) Reply with quote

I have a fairly basic setup - OpenRC, Alsa, Wayland and Weston - I wish to start wayland on boot but I'm not exactly sure how - I attempted to start with a basic init script (below), but it appears that it wont start with the error 'weston-launch: failed to open tty: No such file or directory'. I expect this is because Wayland appears to consume the executing TTY as opposed to the X11/XDM ecosystem which seems to create VT7.

Edit: I should mention that if I start wayland via an interactive shell it works, via SSH or setting to run on boot does not.

I'm fairly new to the wayland scene and I'm pretty confident I'm doing something wrong, but I can't find much support for openrc systems - can anybody assist :roll: ?

Code:

~ # cat /etc/init.d/weston
#!/sbin/openrc-run
#
### BEGIN INIT INFO
# Provides: weston
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

killproc() {
    pid=`/usr/bin/pidof $1`
    [ "$pid" != "" ] && kill $pid
}


start(){
    . /etc/profile
    # This is all a nasty hack
    if test -z "$XDG_RUNTIME_DIR"; then
   export XDG_RUNTIME_DIR=/home/media
   mkdir --parents $XDG_RUNTIME_DIR
   chmod 0700 $XDG_RUNTIME_DIR
    fi
    weston-launch -u media --tty 1 -- -c /home/media/.config/weston.ini & disown
    return 0;
}
stop(){
    killproc weston;
    return 0;
}
~ # /etc/init.d/weston restart
weston-launch: failed to open tty: No such file or directory


Last edited by clin on Sun Apr 01, 2018 2:22 am; edited 1 time in total
Back to top
View user's profile Send private message
clin
n00b
n00b


Joined: 31 Mar 2018
Posts: 2

PostPosted: Sun Apr 01, 2018 2:21 am    Post subject: Reply with quote

Solved the issue somewhat, following https://wiki.gentoo.org/wiki/Automatic_login_to_virtual_console and https://wiki.parabola.nu/Wayland#Autostart looks like I have something that partially works (though it's not as nice as an init script). My bashrc looks like this:

Code:

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
   export XDG_RUNTIME_DIR=/home/clin
   dbus-run-session -- weston-launch -- -c /home/clin/.config/weston.ini
fi
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Apr 01, 2018 10:41 am    Post subject: Reply with quote

A compositor (here Weston) is analogous to the X display server in the "display" system. Wayland is a protocol that characterizes the new "display" system.

Edit

Gentoo can be characterized by modes of operation called runlevels. A runlevel notably allows to start and stop a set of services (see remark).
Gentoo init system (essentially OpenRC) facilitates management of runlevels. An administrator may define new services,
add or remove services in a runlevel and change the active runlevel of Gentoo.

Note: daemons (processes constantly running in the background) may manage system features: open a login shell, close a remote connection...

See also:


Last edited by Mr. T. on Sun Apr 01, 2018 1:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Apr 01, 2018 1:09 pm    Post subject: Reply with quote

clin, Gentoo sometimes provide configuration files for init services.

Handbook wrote:
Init scripts can be quite complex. It is therefore not really desirable to have the users edit the init script directly, as it would make it more error-prone. [...]

Gentoo provides an easy way to configure such a service: every init script that can be configured has a file in /etc/conf.d/ [...]


Is it really essential to run Weston on boot?

Edit: There are several types of compositors and Wayland does not support remote rendering. I didn't find a lot of information about Weston.

Edit: fixed a mistake.
Edit: added the hyperlink.

See also:

Edit: clin: I believe that your configuration is unsuitable to launch Weston: D-Bus && dbus-session-run.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5592

PostPosted: Sun Apr 01, 2018 6:03 pm    Post subject: Reply with quote

Sauntering into a topic marked solved and snobsplaining to the OP while telling them they're doing it wrong is not constructive in the slightest. Changing your username won't hide that fact. Stop.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Mon Apr 02, 2018 6:22 am    Post subject: Reply with quote

@Ant P.: infamous censor, your grandiloquence goes beyond the borders without equivalence! :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum