Back to Knowledege base

Removing Xi-Batch from Your System

Complete uninstallation procedures for RPM and tarball installations

Before You Begin

⚠️ WARNING: Data Loss

Uninstalling Xi-Batch removes all scheduled jobs, variables, and job history. Backup any data you need to preserve before proceeding.

⚠️ WARNING: Service Interruption

Uninstallation stops all scheduling services. Running jobs will be terminated. Schedule uninstallation during maintenance windows.

Backup Important Data

Before uninstalling, save critical configuration:

bash

# Create backup directory
BACKUP_DIR="/usr/batchsave/final-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BACKUP_DIR/Scripts"
cd "$BACKUP_DIR"

# Export jobs
xb-cjlist -D /var/spool/xi/batch btsched_jfile Jcmd Scripts

# Export variables
xb-cvlist -D /var/spool/xi/batch btsched_vfile Vcmd

# Export command interpreters
xb-ccilist -D /var/spool/xi/batch Icmd

# Export users
xb-cusers > Ucmd

# Export holidays
xb-cholist > Hcmd

# Backup configuration files
cp /etc/Xibatch-config .
cp /etc/Xibatch-hosts .

Determine Installation Type

Check which installation method was used:

bash

# Check for RPM installation
rpm -q xibatch_legacy_standard

# Check for tarball installation
ls -d /usr/spool/xi_distrib/Batch 2>/dev/null

Uninstalling RPM Installation

Step 1: Stop Xi-Batch

bash

# Stop the service
btquit -y

# Verify stopped
ps aux | grep btsched

Step 2: Remove RPM Package

bash

# Uninstall package
rpm -e xibatch_legacy_standard

# Verify removal
rpm -q xibatch_legacy_standard

Expected output: package xibatch_legacy_standard is not installed

Step 3: Clean Up IPC Resources

RPM removal doesn't automatically clean IPC resources:

bash

# Use utility if available
xb-ripc -d

# Manual cleanup if xb-ripc not available
# Check for remaining IPC resources
ipcs -m | grep "0x5869b"
ipcs -q | grep "0x5869b"
ipcs -s | grep "0x5869b"

# Remove shared memory segments
ipcs -m | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -m "$id"
done

# Remove message queues
ipcs -q | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -q "$id"
done

# Remove semaphores
ipcs -s | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -s "$id"
done

Step 4: Remove Data Directories (Optional)

RPM uninstall leaves data directories intact:

bash

# Remove spool directory
rm -rf /var/spool/xi/batch/

# Remove distribution directory (if present)
rm -rf /usr/spool/xi_distrib/Batch/

Step 5: Remove Configuration Files (Optional)

bash

# Remove system configuration
rm -f /etc/Xibatch-config
rm -f /etc/Xibatch-hosts

# Remove service files (systemd)
rm -f /etc/systemd/system/xibatch.service
systemctl daemon-reload

# Remove service files (SysV init)
rm -f /etc/init.d/xibatch
rm -f /etc/rc*.d/*xibatch

Step 6: Remove System User (Optional)

bash

# Remove batch user if no longer needed
userdel batch

# Remove group if it exists and is empty
groupdel batch

Uninstalling Tarball Installation

Step 1: Stop Xi-Batch

bash

# Stop the service
btquit -y

# Verify stopped
ps aux | grep btsched

Step 2: Locate UNINSTALL Script

Tarball installations include an UNINSTALL script:

bash

# Typical location
cd /usr/spool/xi_distrib/Batch

# Verify script exists
ls -l UNINSTALL

Step 3: Run UNINSTALL Script

bash

# Execute uninstaller as root
./UNINSTALL

The UNINSTALL script removes:

  • Binary files from user programs directory
  • Internal programs from system directory
  • Help files and resources
  • Symbolic links

If UNINSTALL script is not available, proceed with manual removal below.

Step 4: Manual Removal (If UNINSTALL Unavailable)

Remove User Programs

User programs typically in /usr/local/bin or /usr/bin:

bash

# List of Xi-Batch user programs
cd /usr/local/bin  # Adjust path if needed

# Remove user commands
rm -f btr btq btjlist btjchange btjdel btjstat
rm -f btvar btvlist btcilist btciadd btcidel
rm -f btuser btstart btquit
rm -f xb-checklic xb-vwrite xb-ripc
rm -f xb-cjlist xb-cvlist xb-ccilist xb-cusers xb-cholist

# Remove symlinks if they exist
rm -f bt* xb-*

For non-bash shells (POSIX compatible):

sh

#!/bin/sh
# POSIX-compatible removal

cd /usr/local/bin
for prog in btr btq btjlist btjchange btjdel btjstat \
            btvar btvlist btcilist btciadd btcidel \
            btuser btstart btquit; do
    rm -f "$prog"
done

Remove Internal Programs

Internal programs typically in /usr/spool/progs:

bash

cd /usr/spool/progs

# Remove scheduler and daemons
rm -f btsched xbnetserv

# Remove internal utilities
rm -f btexec

# Remove help files
rm -f btq.help btuser.help btrest.help int-config

# Remove utility scripts and programs
rm -f xb-ripc xb-cjlist xb-cvlist xb-ccilist
rm -f xb-cusers xb-cholist

Remove Spool Directory

bash

# Remove spool files and directory
rm -rf /var/spool/xi/batch/
# Or if different location
rm -rf /usr/spool/xi/batch/

Remove Distribution Directory

bash

# Remove distribution files
rm -rf /usr/spool/xi_distrib/Batch/

Step 5: Clean Up IPC Resources

bash

# Use utility if still available
xb-ripc -d

# Manual cleanup (POSIX-compatible)
ipcs -m | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -m "$id"
done

ipcs -q | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -q "$id"
done

ipcs -s | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -s "$id"
done

# Verify cleanup
ipcs -a | grep "0x5869b"

Step 6: Remove Configuration Files

bash

# Remove system configuration
rm -f /etc/Xibatch-config
rm -f /etc/Xibatch-hosts

Step 7: Remove System Startup

For systemd systems:

bash

systemctl stop xibatch
systemctl disable xibatch
rm -f /etc/systemd/system/xibatch.service
systemctl daemon-reload

For SysV init systems:

bash

/etc/init.d/xibatch stop
rm -f /etc/init.d/xibatch
rm -f /etc/rc*.d/*xibatch

Step 8: Remove System User

bash

# Remove batch user (if not needed by Xi-Text)
userdel batch

# Remove group if empty
groupdel batch

Verification Steps

After uninstallation, verify complete removal:

Check Processes

bash

# No Xi-Batch processes should be running
ps aux | grep -E 'btsched|xbnetserv'

Expected: No results (or only the grep command itself)

Check IPC Resources

bash

# No Xi-Batch IPC resources should remain
ipcs -a | grep "0x5869b"

Expected: No results

Check Files

bash

# Check user programs directory
ls -l /usr/local/bin/bt* 2>/dev/null
ls -l /usr/local/bin/xb-* 2>/dev/null

# Check internal programs
ls -l /usr/spool/progs/bt* 2>/dev/null
ls -l /usr/spool/progs/xb* 2>/dev/null

# Check spool directory
ls -d /var/spool/xi/batch/ 2>/dev/null
ls -d /usr/spool/xi/batch/ 2>/dev/null

# Check distribution directory
ls -d /usr/spool/xi_distrib/Batch/ 2>/dev/null

Expected: All commands should return "No such file or directory"

Check Configuration

bash

# Check system configuration files
ls -l /etc/Xibatch-* 2>/dev/null

Expected: No results

Check Services

bash

# Check systemd
systemctl status xibatch 2>&1 | grep -q "could not be found"

# Check SysV init
ls /etc/init.d/xibatch 2>/dev/null
ls /etc/rc*.d/*xibatch 2>/dev/null

Expected: Service not found, init scripts don't exist

Check User

bash

# Check if batch user exists
id batch 2>&1

Expected: "no such user" (unless Xi-Text is still using it)

Platform-Specific Considerations

HP-UX

IPC removal:

sh

# HP-UX may require different approach
ipcs -m | grep "0x5869b" | while read type id key mode owner group; do
    ipcrm -m "$id"
done

User removal:

sh

/usr/sbin/userdel batch

AIX

IPC removal:

sh

# AIX ipcs format
ipcs -m | grep "0x5869b" | awk '{print $2}' | while read id; do
    ipcrm -m "$id"
done

User removal:

sh

rmuser batch

Solaris

IPC removal:

sh

# Use nawk on Solaris
ipcs -m | grep "0x5869b" | nawk '{print $2}' | while read id; do
    ipcrm -m "$id"
done

User removal:

sh

/usr/sbin/userdel batch

Older Unix Without Bash

POSIX shell compatible verification:

sh

#!/bin/sh
# POSIX-compatible verification

# Check processes
ps -ef | grep btsched | grep -v grep

# Check files
for dir in /usr/local/bin /usr/spool/progs; do
    if [ -d "$dir" ]; then
        cd "$dir"
        ls bt* 2>/dev/null
        ls xb-* 2>/dev/null
    fi
done

# IPC cleanup
ipcs -m | grep "0x5869b" | while read line; do
    id=$(echo "$line" | awk '{print $2}')
    ipcrm -m "$id"
done

Troubleshooting

"Permission denied" errors : Ensure running as root or with sudo privileges

IPC resources won't delete : Verify no Xi-Batch processes running. Check for hung jobs:

bash

ps aux | grep -v grep | grep -E 'btsched|btexec'

Force kill any remaining:

bash

pkill -9 btsched
pkill -9 btexec

Files remain after uninstall : Search for orphaned files:

bash

find / -name "bt*" -user batch 2>/dev/null
find / -name "xb-*" 2>/dev/null
find / -name "*xibatch*" 2>/dev/null

RPM removal fails with dependencies : Use force removal: rpm -e --nodeps xibatch_legacy_standard

UNINSTALL script missing : Use manual removal procedure. Check installation media for script.

Cannot remove user (user busy) : Check for processes owned by batch user:

bash

ps aux | grep batch
lsof -u batch

Jobs still running : Allow jobs to complete or force terminate:

bash

# List running jobs
btjlist | grep " Run "

# Force kill job processes
ps aux | grep btexec | awk '{print $2}' | xargs kill -9

Complete Uninstall Checklist

Use this checklist to ensure complete removal:

Pre-uninstall:

  • Backup jobs, variables, and configuration
  • Notify users of scheduled downtime
  • Document current system state

Uninstall:

  • Stop Xi-Batch service
  • Remove RPM package OR run UNINSTALL script
  • Clean IPC resources
  • Remove spool directories
  • Remove configuration files
  • Remove system startup files
  • Remove system user (if appropriate)

Verification:

  • No processes running
  • No IPC resources remaining
  • No files in user programs directory
  • No files in internal programs directory
  • No spool directory
  • No configuration files
  • No service files
  • System user removed (if appropriate)

Post-uninstall:

  • Verify backups are complete and accessible
  • Document uninstallation date and reason
  • Notify users of completion
Removing Xi-Text from Your System
Complete uninstallation procedures for RPM and tarball installations