From 217d0eb26ebf5c0570b2a5075648b90a04307a13 Mon Sep 17 00:00:00 2001 From: "Josh.5" Date: Wed, 26 Jan 2022 15:41:31 +1300 Subject: [PATCH] Need to be able to init on any distro. The current supervisor.d configs are configured specifically for a particular supervisor version / installation. This decouples the configuration so we can use it on any distro. --- overlay/entrypoint.sh | 4 +- overlay/etc/cont-init.d/10-setup_user.sh | 8 + overlay/etc/cont-init.d/30-configure_dbus.sh | 4 +- overlay/etc/cont-init.d/30-configure_udev.sh | 12 +- .../etc/cont-init.d/50-configure_vnc_audio.sh | 17 +- overlay/etc/cont-init.d/90-configure_xorg.sh | 11 +- .../dbus.conf => supervisor.d/dbus.ini} | 2 +- .../xfce4.conf => supervisor.d/desktop.ini} | 8 +- .../pulseaudio.ini} | 7 +- .../sshd.conf => supervisor.d/sshd.ini} | 0 .../steam.conf => supervisor.d/steam.ini} | 0 .../udev.conf => supervisor.d/udev.ini} | 0 .../vnc-audio.ini} | 0 .../conf.d/vnc.conf => supervisor.d/vnc.ini} | 0 .../xorg.conf => supervisor.d/xorg.ini} | 6 +- overlay/etc/supervisord.conf | 152 ++++++++++++++++++ overlay/usr/bin/start-desktop.sh | 29 ++++ overlay/usr/bin/start-xorg.sh | 6 +- 18 files changed, 233 insertions(+), 33 deletions(-) rename overlay/etc/{supervisor/conf.d/dbus.conf => supervisor.d/dbus.ini} (100%) rename overlay/etc/{supervisor/conf.d/xfce4.conf => supervisor.d/desktop.ini} (63%) rename overlay/etc/{supervisor/conf.d/pulseaudio.conf => supervisor.d/pulseaudio.ini} (67%) rename overlay/etc/{supervisor/conf.d/sshd.conf => supervisor.d/sshd.ini} (100%) rename overlay/etc/{supervisor/conf.d/steam.conf => supervisor.d/steam.ini} (100%) rename overlay/etc/{supervisor/conf.d/udev.conf => supervisor.d/udev.ini} (100%) rename overlay/etc/{supervisor/conf.d/vnc-audio.conf => supervisor.d/vnc-audio.ini} (100%) rename overlay/etc/{supervisor/conf.d/vnc.conf => supervisor.d/vnc.ini} (100%) rename overlay/etc/{supervisor/conf.d/xorg.conf => supervisor.d/xorg.ini} (68%) create mode 100644 overlay/etc/supervisord.conf create mode 100644 overlay/usr/bin/start-desktop.sh diff --git a/overlay/entrypoint.sh b/overlay/entrypoint.sh index 8a54972..928bf89 100644 --- a/overlay/entrypoint.sh +++ b/overlay/entrypoint.sh @@ -5,7 +5,7 @@ # File Created: Saturday, 8th January 2022 7:08:46 pm # Author: Josh.5 (jsunnex@gmail.com) # ----- -# Last Modified: Monday, 17th January 2022 11:40:27 pm +# Last Modified: Saturday, 22nd January 2022 8:03:33 pm # Modified By: Console and webGui login account (jsunnex@gmail.com) ### @@ -63,4 +63,4 @@ echo "Logging all user services to '/home/${USER}/.cache/log/'" echo mkdir -p /var/log/supervisor chmod a+rw /var/log/supervisor -exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf --nodaemon --user root +exec /usr/bin/supervisord -c /etc/supervisord.conf --nodaemon --user root diff --git a/overlay/etc/cont-init.d/10-setup_user.sh b/overlay/etc/cont-init.d/10-setup_user.sh index 9215adf..8aa3ab8 100644 --- a/overlay/etc/cont-init.d/10-setup_user.sh +++ b/overlay/etc/cont-init.d/10-setup_user.sh @@ -15,11 +15,19 @@ echo "Setting umask to ${UMASK}"; umask ${UMASK} +echo "Create the user XDG_RUNTIME_DIR" +XDG_RUNTIME_DIR=/run/user/${PUID} +mkdir -p ${XDG_RUNTIME_DIR} +chown -R ${PUID}:${PGID} ${XDG_RUNTIME_DIR} +export XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/flatpak/exports/share:/home/${USER}/.local/share/flatpak/exports/share" + + # Setup home directory and permissions echo "Adding default home directory template" mkdir -p ${USER_HOME} chown -R ${PUID}:${PGID} /etc/home_directory_template rsync -aq /etc/home_directory_template/ ${USER_HOME}/ +chmod +x /usr/bin/start-desktop.sh # Set the root and user password diff --git a/overlay/etc/cont-init.d/30-configure_dbus.sh b/overlay/etc/cont-init.d/30-configure_dbus.sh index 481c624..ac41bdd 100644 --- a/overlay/etc/cont-init.d/30-configure_dbus.sh +++ b/overlay/etc/cont-init.d/30-configure_dbus.sh @@ -4,11 +4,11 @@ echo "**** Configure container dbus ****"; if [[ "${HOST_DBUS}" == "true" ]]; then echo "Container configured to use the host dbus"; # Disable supervisord script - sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/dbus.conf + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/dbus.ini else echo "Container configured to run its own dbus"; # Enable supervisord script - sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/dbus.conf + sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/dbus.ini # Configure dbus to run as USER sed -i "/ /c\ ${USER}" /usr/share/dbus-1/system.conf # Remove old dbus session diff --git a/overlay/etc/cont-init.d/30-configure_udev.sh b/overlay/etc/cont-init.d/30-configure_udev.sh index cabc163..66d1c72 100644 --- a/overlay/etc/cont-init.d/30-configure_udev.sh +++ b/overlay/etc/cont-init.d/30-configure_udev.sh @@ -5,8 +5,8 @@ # File Created: Friday, 12th January 2022 8:54:01 am # Author: Josh.5 (jsunnex@gmail.com) # ----- -# Last Modified: Friday, 14th January 2022 9:21:11 am -# Modified By: Josh.5 (jsunnex@gmail.com) +# Last Modified: Saturday, 22nd January 2022 8:20:34 pm +# Modified By: Console and webGui login account (jsunnex@gmail.com) ### # Running udev only works in privileged container @@ -25,14 +25,16 @@ rm -rf "${tmp_mount}" if [[ "${is_privileged}" == "true" ]]; then echo "**** Configure container to run udev management ****"; # Enable supervisord script - sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/udev.conf + sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/udev.ini # Make startup script executable chmod +x /usr/bin/start-udev.sh # Configure udev permissions - sed -i 's/MODE="0660"/MODE="0666"/' /lib/udev/rules.d/60-steam-input.rules + if [[ -f /lib/udev/rules.d/60-steam-input.rules ]]; then + sed -i 's/MODE="0660"/MODE="0666"/' /lib/udev/rules.d/60-steam-input.rules + fi else # Disable supervisord script - sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/udev.conf + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/udev.ini fi diff --git a/overlay/etc/cont-init.d/50-configure_vnc_audio.sh b/overlay/etc/cont-init.d/50-configure_vnc_audio.sh index e0cce6e..ce66c8f 100644 --- a/overlay/etc/cont-init.d/50-configure_vnc_audio.sh +++ b/overlay/etc/cont-init.d/50-configure_vnc_audio.sh @@ -1,12 +1,13 @@ echo "**** Configure VNC audio ****" -if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then - echo "Configure pulseaudio to use a socket to pipe audio to VNC" - sed -i 's|^; default-server.*$|default-server = unix:/tmp/pulseaudio.socket|' /etc/pulse/client.conf - sed -i 's|^load-module module-native-protocol-unix.*$|load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1|' \ - /etc/pulse/default.pa - chown -R ${USER} /etc/pulse +echo "Configure pulseaudio to pipe audio to a socket" +sed -i 's|^; default-server.*$|default-server = unix:/tmp/pulseaudio.socket|' /etc/pulse/client.conf +sed -i 's|^load-module module-native-protocol-unix.*$|load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1|' \ + /etc/pulse/default.pa +chown -R ${USER} /etc/pulse + +if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then # Credits for this audio patch: # - https://github.com/novnc/noVNC/issues/302 # - https://github.com/vexingcodes/dwarf-fortress-docker @@ -19,7 +20,7 @@ if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then rm /opt/noVNC/audio.patch fi # Enable supervisord script - sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/vnc-audio.conf + sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc-audio.ini # Remove x11vnc from applications menu if ! grep -q 'Hidden=true' /usr/share/applications/x11vnc.desktop; then @@ -29,7 +30,7 @@ else echo "Disable audio stream" echo "Disable audio websock" # Disable supervisord script - sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/vnc-audio.conf + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini fi echo "DONE" diff --git a/overlay/etc/cont-init.d/90-configure_xorg.sh b/overlay/etc/cont-init.d/90-configure_xorg.sh index b1a0706..c7e9758 100644 --- a/overlay/etc/cont-init.d/90-configure_xorg.sh +++ b/overlay/etc/cont-init.d/90-configure_xorg.sh @@ -51,19 +51,24 @@ function configure_x_server { mkdir -p /tmp/.X11-unix fi + # Ensure X-windows session path is owned by root + mkdir -p /tmp/.ICE-unix + chown root:root /tmp/.ICE-unix/ + chmod 1777 /tmp/.ICE-unix/ + # Check if this container is being run as a secondary instance if [ "${MODE}" == "p" ] | [ "${MODE}" == "primary" ]; then echo "Configure container as primary the X server" # Enable supervisord script - sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/xorg.conf + sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/xorg.ini elif [ "${MODE}" == "fb" ] | [ "${MODE}" == "framebuffer" ]; then echo "Configure container to use a virtual framebuffer as the X server" # Disable supervisord script - sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/xorg.conf + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/xorg.ini else echo "Configure container as secondary and do not run an X server" # Disable supervisord script - sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/xorg.conf + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/xorg.ini fi # Make startup script executable chmod +x /usr/bin/start-xorg.sh diff --git a/overlay/etc/supervisor/conf.d/dbus.conf b/overlay/etc/supervisor.d/dbus.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/dbus.conf rename to overlay/etc/supervisor.d/dbus.ini index 48a87b0..18f5a69 100644 --- a/overlay/etc/supervisor/conf.d/dbus.conf +++ b/overlay/etc/supervisor.d/dbus.ini @@ -2,9 +2,9 @@ [program:dbus] autostart=true priority=10 +user=%(ENV_USER)s directory=/ command=dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork --nopidfile -user=%(ENV_USER)s environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s" autorestart=true stopsignal=QUIT diff --git a/overlay/etc/supervisor/conf.d/xfce4.conf b/overlay/etc/supervisor.d/desktop.ini similarity index 63% rename from overlay/etc/supervisor/conf.d/xfce4.conf rename to overlay/etc/supervisor.d/desktop.ini index 1f4b7f8..d819fd8 100644 --- a/overlay/etc/supervisor/conf.d/xfce4.conf +++ b/overlay/etc/supervisor.d/desktop.ini @@ -1,16 +1,16 @@ -[program:xfce4] +[program:desktop] autostart=true autorestart=true priority=50 user=%(ENV_USER)s directory=/home/%(ENV_USER)s -command=/usr/bin/startxfce4 +command=/usr/bin/start-desktop.sh environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" stopsignal=QUIT -stdout_logfile=/home/%(ENV_USER)s/.cache/log/xfce4.log +stdout_logfile=/home/%(ENV_USER)s/.cache/log/desktop.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=7 -stderr_logfile=/home/%(ENV_USER)s/.cache/log/xfce4.err.log +stderr_logfile=/home/%(ENV_USER)s/.cache/log/desktop.err.log stderr_logfile_maxbytes=10MB stderr_logfile_backups=7 diff --git a/overlay/etc/supervisor/conf.d/pulseaudio.conf b/overlay/etc/supervisor.d/pulseaudio.ini similarity index 67% rename from overlay/etc/supervisor/conf.d/pulseaudio.conf rename to overlay/etc/supervisor.d/pulseaudio.ini index a27134e..f6e1cc9 100644 --- a/overlay/etc/supervisor/conf.d/pulseaudio.conf +++ b/overlay/etc/supervisor.d/pulseaudio.ini @@ -3,13 +3,16 @@ autostart=true autorestart=true priority=10 +# TODO: Should this run as user +#user=root user=%(ENV_USER)s command=/usr/bin/pulseaudio -vvvv --disallow-module-loading --disallow-exit --exit-idle-time=-1 +#command=/usr/bin/pulseaudio -vvvv --system --disallow-module-loading --disallow-exit --exit-idle-time=-1 environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s" stopsignal=QUIT stdout_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.log -stdout_logfile_maxbytes=10MB +stdout_logfile_maxbytes=2MB stdout_logfile_backups=7 stderr_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.err.log -stderr_logfile_maxbytes=10MB +stderr_logfile_maxbytes=2MB stderr_logfile_backups=7 diff --git a/overlay/etc/supervisor/conf.d/sshd.conf b/overlay/etc/supervisor.d/sshd.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/sshd.conf rename to overlay/etc/supervisor.d/sshd.ini diff --git a/overlay/etc/supervisor/conf.d/steam.conf b/overlay/etc/supervisor.d/steam.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/steam.conf rename to overlay/etc/supervisor.d/steam.ini diff --git a/overlay/etc/supervisor/conf.d/udev.conf b/overlay/etc/supervisor.d/udev.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/udev.conf rename to overlay/etc/supervisor.d/udev.ini diff --git a/overlay/etc/supervisor/conf.d/vnc-audio.conf b/overlay/etc/supervisor.d/vnc-audio.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/vnc-audio.conf rename to overlay/etc/supervisor.d/vnc-audio.ini diff --git a/overlay/etc/supervisor/conf.d/vnc.conf b/overlay/etc/supervisor.d/vnc.ini similarity index 100% rename from overlay/etc/supervisor/conf.d/vnc.conf rename to overlay/etc/supervisor.d/vnc.ini diff --git a/overlay/etc/supervisor/conf.d/xorg.conf b/overlay/etc/supervisor.d/xorg.ini similarity index 68% rename from overlay/etc/supervisor/conf.d/xorg.conf rename to overlay/etc/supervisor.d/xorg.ini index 1dae47f..a126db2 100644 --- a/overlay/etc/supervisor/conf.d/xorg.conf +++ b/overlay/etc/supervisor.d/xorg.ini @@ -5,11 +5,11 @@ autorestart=true priority=20 user=root command=/usr/bin/start-xorg.sh -environment=DISPLAY="%(ENV_DISPLAY)s",DISPLAY_DPI="%(ENV_DISPLAY_DPI)s",XDG_RUNTIME_DIR="/tmp/.X11-unix" +environment=DISPLAY="%(ENV_DISPLAY)s",DISPLAY_DPI="%(ENV_DISPLAY_DPI)s" stopsignal=QUIT -stdout_logfile=/var/log/supervisor/xorg.log +#stdout_logfile=/var/log/supervisor/xorg.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=7 -stderr_logfile=/var/log/supervisor/xorg.err.log +#stderr_logfile=/var/log/supervisor/xorg.err.log stderr_logfile_maxbytes=10MB stderr_logfile_backups=7 diff --git a/overlay/etc/supervisord.conf b/overlay/etc/supervisord.conf new file mode 100644 index 0000000..a7a15a2 --- /dev/null +++ b/overlay/etc/supervisord.conf @@ -0,0 +1,152 @@ +; Sample supervisor config file. +; +; For more information on the config file, please see: +; http://supervisord.org/configuration.html +; +; Notes: +; - Shell expansion ("~" or "$HOME") is not supported. Environment +; variables can be expanded using this syntax: "%(ENV_HOME)s". +; - Quotes around values are not supported, except in the case of +; the environment= options as shown below. +; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". +; - Command will be truncated if it looks like a config file comment, e.g. +; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ". + +[unix_http_server] +file=/run/supervisor.sock ; the path to the socket file +;chmod=0700 ; socket file mode (default 0700) +;chown=nobody:nogroup ; socket file uid:gid owner +;username=user ; default is no username (open server) +;password=123 ; default is no password (open server) + +[inet_http_server] ; inet (TCP) server disabled by default +port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface +;username=user ; default is no username (open server) +;password=123 ; default is no password (open server) + +[supervisord] +logfile=/var/log/supervisord.log ; main log file; default $CWD/supervisord.log +logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB +logfile_backups=10 ; # of main logfile backups; 0 means none, default 10 +loglevel=info ; log level; default info; others: debug,warn,trace +pidfile=/run/supervisord.pid ; supervisord pidfile; default supervisord.pid +nodaemon=false ; start in foreground if true; default false +minfds=1024 ; min. avail startup file descriptors; default 1024 +minprocs=200 ; min. avail process descriptors;default 200 +;umask=022 ; process file creation umask; default 022 +;user=supervisord ; setuid to this UNIX account at startup; recommended if root +;identifier=supervisor ; supervisord identifier, default is 'supervisor' +;directory=/tmp ; default is not to cd during start +;nocleanup=true ; don't clean up tempfiles at start; default false +childlogdir=/var/log/supervisor ; 'AUTO' child log dir, default $TEMP +;environment=KEY="value" ; key value pairs to add to environment +;strip_ansi=false ; strip ansi escape codes in logs; def. false + +; The rpcinterface:supervisor section must remain in the config file for +; RPC (supervisorctl/web interface) to work. Additional interfaces may be +; added by defining them in separate [rpcinterface:x] sections. + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +; The supervisorctl section configures how supervisorctl will connect to +; supervisord. configure it match the settings in either the unix_http_server +; or inet_http_server section. + +[supervisorctl] +serverurl=unix:///run/supervisor.sock ; use a unix:// URL for a unix socket +;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket +;username=chris ; should be same as in [*_http_server] if set +;password=123 ; should be same as in [*_http_server] if set +;prompt=mysupervisor ; cmd line prompt (default "supervisor") +;history_file=~/.sc_history ; use readline history if available + +; The sample program section below shows all possible program subsection values. +; Create one or more 'real' program: sections to be able to control them under +; supervisor. + +;[program:theprogramname] +;command=/bin/cat ; the program (relative uses PATH, can take args) +;process_name=%(program_name)s ; process_name expr (default %(program_name)s) +;numprocs=1 ; number of processes copies to start (def 1) +;directory=/tmp ; directory to cwd to before exec (def no cwd) +;umask=022 ; umask for process (default None) +;priority=999 ; the relative start priority (default 999) +;autostart=true ; start at supervisord start (default: true) +;startsecs=1 ; # of secs prog must stay up to be running (def. 1) +;startretries=3 ; max # of serial start failures when starting (default 3) +;autorestart=unexpected ; when to restart if exited after running (def: unexpected) +;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) +;stopsignal=QUIT ; signal used to kill process (default TERM) +;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) +;stopasgroup=false ; send stop signal to the UNIX process group (default false) +;killasgroup=false ; SIGKILL the UNIX process group (def false) +;user=chrism ; setuid to this UNIX account to run the program +;redirect_stderr=true ; redirect proc stderr to stdout (default false) +;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO +;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) +;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) +;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) +;stdout_events_enabled=false ; emit events on stdout writes (default false) +;stdout_syslog=false ; send stdout to syslog with process name (default false) +;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO +;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) +;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) +;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) +;stderr_events_enabled=false ; emit events on stderr writes (default false) +;stderr_syslog=false ; send stderr to syslog with process name (default false) +;environment=A="1",B="2" ; process environment additions (def no adds) +;serverurl=AUTO ; override serverurl computation (childutils) + +; The sample eventlistener section below shows all possible eventlistener +; subsection values. Create one or more 'real' eventlistener: sections to be +; able to handle event notifications sent by supervisord. + +;[eventlistener:theeventlistenername] +;command=/bin/eventlistener ; the program (relative uses PATH, can take args) +;process_name=%(program_name)s ; process_name expr (default %(program_name)s) +;numprocs=1 ; number of processes copies to start (def 1) +;events=EVENT ; event notif. types to subscribe to (req'd) +;buffer_size=10 ; event buffer queue size (default 10) +;directory=/tmp ; directory to cwd to before exec (def no cwd) +;umask=022 ; umask for process (default None) +;priority=-1 ; the relative start priority (default -1) +;autostart=true ; start at supervisord start (default: true) +;startsecs=1 ; # of secs prog must stay up to be running (def. 1) +;startretries=3 ; max # of serial start failures when starting (default 3) +;autorestart=unexpected ; autorestart if exited after running (def: unexpected) +;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) +;stopsignal=QUIT ; signal used to kill process (default TERM) +;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) +;stopasgroup=false ; send stop signal to the UNIX process group (default false) +;killasgroup=false ; SIGKILL the UNIX process group (def false) +;user=chrism ; setuid to this UNIX account to run the program +;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners +;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO +;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) +;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) +;stdout_events_enabled=false ; emit events on stdout writes (default false) +;stdout_syslog=false ; send stdout to syslog with process name (default false) +;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO +;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) +;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) +;stderr_events_enabled=false ; emit events on stderr writes (default false) +;stderr_syslog=false ; send stderr to syslog with process name (default false) +;environment=A="1",B="2" ; process environment additions +;serverurl=AUTO ; override serverurl computation (childutils) + +; The sample group section below shows all possible group values. Create one +; or more 'real' group: sections to create "heterogeneous" process groups. + +;[group:thegroupname] +;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions +;priority=999 ; the relative start priority (default 999) + +; The [include] section can just contain the "files" setting. This +; setting can list multiple files (separated by whitespace or +; newlines). It can also contain wildcards. The filenames are +; interpreted as relative to this file. Included files *cannot* +; include files themselves. + +[include] +files = /etc/supervisor.d/*.ini diff --git a/overlay/usr/bin/start-desktop.sh b/overlay/usr/bin/start-desktop.sh new file mode 100644 index 0000000..9d1b676 --- /dev/null +++ b/overlay/usr/bin/start-desktop.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +### +# File: start-desktop.sh +# Project: bin +# File Created: Thursday, 1st January 1970 12:00:00 pm +# Author: Console and webGui login account (jsunnex@gmail.com) +# ----- +# Last Modified: Wednesday, 26th January 2022 3:29:47 pm +# Modified By: Console and webGui login account (jsunnex@gmail.com) +### +# +# I made this wrapper script so that I could easily try a range of desktop environments +# + +XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) +#XAUTHORITY=${XDG_RUNTIME_DIR:-/home/${USER}/.xauthority} +XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/flatpak/exports/share:/home/${USER}/.local/share/flatpak/exports/share" +export $(dbus-launch) + +# TODO: Set the default background + +# Run the desktop environment in order of priority +if [[ -e /usr/bin/cinnamon-session ]]; then + /usr/bin/cinnamon-session --display=${DISPLAY} +elif [[ -e /usr/bin/startplasma-x11 ]]; then + /usr/bin/startplasma-x11 +elif [[ -e /usr/bin/startxfce4 ]]; then + /usr/bin/startxfce4 +fi diff --git a/overlay/usr/bin/start-xorg.sh b/overlay/usr/bin/start-xorg.sh index 8406f18..0ac95d3 100644 --- a/overlay/usr/bin/start-xorg.sh +++ b/overlay/usr/bin/start-xorg.sh @@ -5,13 +5,13 @@ # File Created: Tuesday, 11th January 2022 8:28:52 pm # Author: Josh.5 (jsunnex@gmail.com) # ----- -# Last Modified: Tuesday, 11th January 2022 9:38:51 pm -# Modified By: Josh.5 (jsunnex@gmail.com) +# Last Modified: Monday, 24th January 2022 6:01:38 pm +# Modified By: Console and webGui login account (jsunnex@gmail.com) ### DISPLAY=${DISPLAY:-:55} DISPLAY_DPI=${DPI:-:96} -XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/.X11-unix} +XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) # Clear out old lock files