91 | | BarnOwl can also be run in a screen session to continue receiving messages while offline. For instructions on how to set this up on Athena, see the [http://sipb.mit.edu/doc/zephyr/#screen SIPB documentation]. |
| 84 | It is handy to be able to log your conversations so you can refer back |
| 85 | to them later. To log classes, for example: |
| 86 | |
| 87 | :set classlogging on |
| 88 | |
| 89 | And to log personals: |
| 90 | |
| 91 | :set logging on |
| 92 | |
| 93 | This will log to the "zlog" directory in your locker. You probably |
| 94 | don't want people to see what classes you're on or what people you |
| 95 | talk to, so you can run the Athena commands |
| 96 | |
| 97 | mkdir -p ~/zlog |
| 98 | fs sa ~/zlog system:anyuser none |
| 99 | mkdir -p ~/zlog/people |
| 100 | mkdir -p ~/zlog/class |
| 101 | |
| 102 | to create the necessary directories and make them completely hidden. |
| 103 | |
| 104 | Note that if you want the logging option to still be set after you |
| 105 | quit and relaunch BarnOwl, you will need to prefix the "set" command |
| 106 | with "startup". This is how you would write that: |
| 107 | |
| 108 | :startup set classlogging on |
| 109 | :startup set logging on |
| 110 | |
| 111 | See the "Startup" section above for more information. |
| 112 | |
| 113 | |
| 114 | == Persistence == |
| 115 | |
| 116 | BarnOwl can also be run in a screen session to continue receiving messages while offline. |
| 117 | |
| 118 | It can be very annoying to have to close BarnOwl when you turn off |
| 119 | your computer. During the time your computer is off, you're missing |
| 120 | many (possibly important) zephyrs. It can be aggravating to be using |
| 121 | zephyr via an unreliable network connection. It can also be |
| 122 | frustrating if you leave your computer on with Zephyr up, but go to a |
| 123 | different computer and want to check your zephyrs - how do you do |
| 124 | this? These problems can be solved with the magic of screen. |
| 125 | |
| 126 | A more detailed and extensive explanation of this can be found at |
| 127 | [http://web.mit.edu/kchen/arch/common/bin/owl-screen.txt]. Basic commands are [Ctrl-a] followed by [c] to open a new window (like a tab), [Ctrl-a][w] to see a list of open windows, and [Ctrl-a] followed by a number to go to that window. |
| 128 | |
| 129 | Do note that running `owl-screen` as apposed to just runnning `screen` and then a barnowl instance provides niceties such as reminders to renew your tickets (the process `/mit/kchen/arch/i386_rhel4/bin/cont-renew-notify`). Also, BarnOwl will always be located on the `0` tab of an `owl-screen` instance, so [Ctrl-a][0] will always take you back to BarnOwl. |
| 130 | |
| 131 | === Screen === |
| 132 | |
| 133 | You should find a computer or server on which to run your screen |
| 134 | session(s) that is up all the time, for example, linux.mit.edu. |
| 135 | Screen allows you to run programs inside of it on one computer, and to |
| 136 | access those same programs from other computers via ssh. |
| 137 | |
| 138 | === Quickstart === |
| 139 | |
| 140 | 1. Pick a machine to host your screen session on. |
| 141 | If you don't know of any options, linux.mit.edu (Linerva) is a good choice. |
| 142 | 2. ssh to that machine. |
| 143 | 3. Run "add kchen". You may want to add this to your `~/.environment` file. |
| 144 | 4. Run "owl-screen" |
| 145 | |
| 146 | Your screen session is now ready. Once you start the screen session, |
| 147 | you'll need to get renewable Kerberos tickets in order to run it for |
| 148 | any extended period of time. Press C-a C-c to open a new screen |
| 149 | window, and run |
| 150 | |
| 151 | kinit -l7d -54 |
| 152 | |
| 153 | (length 7 days, both Kerberos 5 and Kerberos 4). Press C-a 0 to return |
| 154 | back to your BarnOwl window. |
| 155 | |
| 156 | When you're ready to log out, press C-a d to "detach" your screen, and |
| 157 | then type `exit` or `logout` to log out. Later, when you want to |
| 158 | "reattach" your screen, ssh to the machine again, and run `screen -r`. |
| 159 | |
| 160 | === Kerberos Tickets and AFS Tokens === |
| 161 | |
| 162 | In order to keep your screen session authenticated, you'll need to |
| 163 | keep your Kerberos tickets and AFS tokens up-to-date. There is a |
| 164 | script that will do this for you, located in the `kchen` locker. |
| 165 | After you ssh into the machine that hosts your screen sessions, run |
| 166 | the following commands: |
| 167 | |
| 168 | add kchen |
| 169 | owl-screen |
| 170 | C-a C-c |
| 171 | kinit -l1d -r7d |
| 172 | |
| 173 | === Attaching and Detaching Sessions === |
| 174 | |
| 175 | To detach a screen session (for example, if you want to log out), |
| 176 | press C-a d (Control-A, then D). Screen continues to run, but is no |
| 177 | longer active. |
| 178 | |
| 179 | To reattach a screen session, possibly detaching from wherever it's |
| 180 | currently attached, run: |
| 181 | |
| 182 | screen -dr |
| 183 | |
| 184 | `screen` can do a whole lot more. To find out about it, see |
| 185 | [UsingScreen](https://sipb-www.scripts.mit.edu:444/doc/wiki/UsingScreen). |