diff options
author | Will Woods <wwoods@redhat.com> | 2012-07-17 15:58:42 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2012-08-02 16:43:59 -0400 |
commit | 2ce721057958ba589bb79189fbe0cb4ec0dd14dd (patch) | |
tree | 27d48b13c64eae45855733705ece57aa0555ddf1 /data | |
parent | 2772f36a5d1d2d05d314640d77d4b647c68823c9 (diff) | |
download | anaconda-2ce721057958ba589bb79189fbe0cb4ec0dd14dd.tar.gz anaconda-2ce721057958ba589bb79189fbe0cb4ec0dd14dd.tar.xz anaconda-2ce721057958ba589bb79189fbe0cb4ec0dd14dd.zip |
Run anaconda inside tmux
Having a shell on tty2 or hvc1 is convenient.. if you have tty2 or hvc1.
But not everyone does - think s390, or POWER, or remote virt guests.
Instead, let's run anaconda inside a tmux session, with windows
pre-configured with a shell, anaconda.log, program.log, and storage.log.
We set this up by using two services: anaconda.service, and
anaconda-tmux@.service.
anaconda.service starts anaconda (and starts watching the logs) inside a
detached tmux session, on screen 1. It also starts a shell on screen 2,
and 'tail -F' on anaconda.log, storage.log, and program.log on screens
3, 4, and 5.
anaconda-tmux@.service will be instantiated on the default console
(tty1, hvc0, ttyS0, whatever) and connect to the running tmux session,
which will show screen 1 - and thus the text UI (if any) appears.
Exiting tmux just restarts anaconda-tmux@.service, which reconnects to
the existing session, so you can't accidentally kill the installer by
leaving tmux.
Diffstat (limited to 'data')
-rw-r--r-- | data/Makefile.am | 3 | ||||
-rw-r--r-- | data/systemd/Makefile.am | 3 | ||||
-rw-r--r-- | data/systemd/anaconda-cleanup-initramfs.service | 2 | ||||
-rwxr-xr-x | data/systemd/anaconda-generator | 2 | ||||
-rw-r--r-- | data/systemd/anaconda-tmux@.service | 15 | ||||
-rw-r--r-- | data/systemd/anaconda.service (renamed from data/systemd/anaconda@.service) | 10 | ||||
-rw-r--r-- | data/systemd/anaconda.target | 1 | ||||
-rw-r--r-- | data/tmux.conf | 16 |
8 files changed, 41 insertions, 11 deletions
diff --git a/data/Makefile.am b/data/Makefile.am index cc82ae5d5..570828195 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -29,6 +29,9 @@ langdir = $(datadir)/$(PACKAGE_NAME) lang_DATA = lang-names dist_lang_DATA = lang-table +tmuxdir = $(datadir)/$(PACKAGE_NAME) +dist_tmux_DATA = tmux.conf + if IS_S390 shareddir = $(datadir)/$(PACKAGE_NAME) dist_shared_SCRIPTS = linuxrc.s390 diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am index 8579ece04..96bd8f0cb 100644 --- a/data/systemd/Makefile.am +++ b/data/systemd/Makefile.am @@ -20,8 +20,9 @@ systemddir = /lib/systemd/system generatordir = /lib/systemd/system-generators -dist_systemd_DATA = anaconda@.service \ +dist_systemd_DATA = anaconda.service \ anaconda.target \ + anaconda-tmux@.service \ anaconda-shell@.service \ instperf.service \ anaconda-sshd.service \ diff --git a/data/systemd/anaconda-cleanup-initramfs.service b/data/systemd/anaconda-cleanup-initramfs.service index 1d10bfc7a..cc493572d 100644 --- a/data/systemd/anaconda-cleanup-initramfs.service +++ b/data/systemd/anaconda-cleanup-initramfs.service @@ -1,6 +1,6 @@ [Unit] Description=Clean Up Initramfs -Before=anaconda@.service +Before=anaconda.service ConditionPathIsDirectory=/run/initramfs/usr/lib/modules [Service] diff --git a/data/systemd/anaconda-generator b/data/systemd/anaconda-generator index cb4704023..71e35e718 100755 --- a/data/systemd/anaconda-generator +++ b/data/systemd/anaconda-generator @@ -25,7 +25,7 @@ done consoletty="$tty" # put anaconda on the real console -service_on_tty anaconda@.service $consoletty +service_on_tty anaconda-tmux@.service $consoletty # put a shell on tty2 and the first virtualization console we find for tty in tty2 hvc0 hvc1 xvc0 hvsi0 hvsi1 hvsi2; do diff --git a/data/systemd/anaconda-tmux@.service b/data/systemd/anaconda-tmux@.service new file mode 100644 index 000000000..0b8376588 --- /dev/null +++ b/data/systemd/anaconda-tmux@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Anaconda Text Console +Requires=anaconda.service +After=anaconda.target anaconda.service + +[Service] +Type=simple +WorkingDirectory=/root +Environment=LANG=en_US.UTF-8 +ExecStartPre=/usr/bin/echo -e \033%G +ExecStart=/usr/bin/tmux -u attach -t anaconda +StandardInput=tty-force +TTYPath=/dev/%I +TTYReset=yes +Restart=always diff --git a/data/systemd/anaconda@.service b/data/systemd/anaconda.service index 03ecabb17..5629e00a8 100644 --- a/data/systemd/anaconda@.service +++ b/data/systemd/anaconda.service @@ -3,11 +3,7 @@ Description=Anaconda After=anaconda.target [Service] -Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin -Type=oneshot +Type=forking +Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=en_US.UTF-8 WorkingDirectory=/root -ExecStart=/usr/sbin/anaconda -StandardInput=tty-force -TTYPath=/dev/%I -TTYReset=yes -TimeoutSec=0 +ExecStart=/usr/bin/tmux -u -f /etc/anaconda-tmux.conf start diff --git a/data/systemd/anaconda.target b/data/systemd/anaconda.target index 9a95c6615..597adfde3 100644 --- a/data/systemd/anaconda.target +++ b/data/systemd/anaconda.target @@ -3,7 +3,6 @@ Description=Anaconda System Services Requires=basic.target After=basic.target AllowIsolate=yes -Before=anaconda@.service Wants=anaconda-cleanup-initramfs.service Wants=instperf.service Wants=rsyslog.service diff --git a/data/tmux.conf b/data/tmux.conf new file mode 100644 index 000000000..3639fcbec --- /dev/null +++ b/data/tmux.conf @@ -0,0 +1,16 @@ +# tmux.conf for the anaconda environment +set-option -s exit-unattached off +set-option -g base-index 1 + +new-session -s anaconda -n main "anaconda" + +set-option set-remain-on-exit on +set-option status-right "" +set-option status-right-length 0 + +new-window -d -n shell "bash --login" +new-window -d -n log "tail -F /tmp/anaconda.log" +new-window -d -n storage-log "tail -F /tmp/storage.log" +new-window -d -n program-log "tail -F /tmp/program.log" + +detach-client -s anaconda |