Presence
Rather than get involved in the nitty-gritty of presence subcriptions right now, let’s use the tools that are around us to get things set up. In order for this to work, we need to be subscribed to the presence of the script that will be invoked when the server dials up and connects to the Internet. The script will connect to the Jabber server using a JID with a username that represents the Linux server: myserver@gnu.pipetree.com. My JID in this case is dj@gnu.pipetree.com, so we just use whatever Jabber client happens to be at hand, say, Jabber Instant Messenger (JIM), to effect both sides of the subscription.
- Step 1: Create JID myserver@gnu.pipetree.com
We need to create the script’s JID if it doesn’t already exist. We can use the reguser script we wrote in Section 7.4 to do this:
[dj@yak dj]$
./reguser gnu.pipetree.com username=myserver password=secret[Attempt] (myserver) Successful registration [dj@yak dj]$- Step 2: Subscribe to myserver’s presence
We start JIM with the JID dj@gnu.pipetree.com and then add myserver@gnu.pipetree.com to the roster. This should automatically send a presence subscription request to the JID. Adding the JID to the roster using JIM is shown in Figure 8-2.
- Step 3: Accept presence subscription as myserver
Using the JIM client, we reconnect with the myserver JID and accept the presence subscription request from Step 2, so that dj@gnu.pipetree.com will automatically receive myserver@gnu.pipetree.com’s availability information. Whether or not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access