Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically start xvnc if it's installed #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pycheribuild/files/cheribsd/rc.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nfs_client_enable="YES"
fsck_y_enable="YES"
fsck_y_flags="-T ffs:-R -T ufs:-R"
crashinfo_enable=NO # gdb runs for 5+ minutes on F1 if present...
xvnc_enable="YES"
if [ -e /fett ]; then
fett_bvrs_enable="YES"
fett_nginx_enable="YES"
Expand Down
18 changes: 18 additions & 0 deletions pycheribuild/projects/cross/x11.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,24 @@ def install(self, **kwargs):
# TODO: should we install a service that we can start with `service xvnc start`?
self.write_file(self.install_dir / "bin/startxvnc", overwrite=True, mode=0o755,
contents="#!/bin/sh\nXvnc -geometry 1024x768 -SecurityTypes=None \"$@\"\n")
self.write_file(self.install_dir / "etc/rc.d/xvnc", overwrite=True, mode=0o755, contents=f"""#!/bin/sh
# PROVIDE: xvnc
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail shutdown
. /etc/rc.subr

name=xvnc
rcvar=xvnc_enable
: "${{xvnc_args="-geometry 1024x768 -SecurityTypes=None"}}"

pidfile="/var/run/${{name}}.pid"
command=/usr/sbin/daemon
command_args="-p ${{pidfile}} -S -T ${{name}} {self.install_prefix / "bin/Xvnc"} ${{xvnc_args}}"

load_rc_config $name
run_rc_command "$1"
""")

def update(self):
super().update()
Expand Down