Installing an Emergency Seven-Day Licence on Xi-Text
Recovering a system whose licence has been lost or damaged with xt-emerglic, and replacing it with a permanent licence
The machine's Xi-Text licence has been lost or damaged, the spooler will not start, and a permanent licence cannot be obtained in time to keep the site printing. xt-emerglic writes a seven-day licence that carries the machine until one arrives. This article gives the procedure, the warning you get before the seven days end, and how to replace it.
What xt-emerglic writes
xt-emerglic writes a seven-day emergency licence into the product's licence file, /usr/libexec/xi/.xitext.lic.
Every packaging format - RPM, Debian package and portable archive - installs the command on the PATH, in /usr/local/bin on a packaged system.
An emergency licence is a licence record in the same format as any other, keyed to its machine's hardware signature in the same way. Copied to a second machine it is invalid there, and a permanent licence installed over it replaces it.
When it applies
- The licence file was lost or damaged by a restore or a disc recovery, and the spooler will not start.
- Production must print now, and a permanent licence cannot be obtained and installed in time.
A new installation from an RPM or Debian package carries a 30-day trial licence, installed at install time; a portable-archive installation carries a 45-day trial. A test or development machine is licensed like any other. Use the emergency licence to recover a system that has lost its licence, and replace it with a permanent licence as the first available action afterwards.
What it checks before it writes
The program checks three things and refuses on any of them.
- You must be root. The command is installed without the set-user-id bit, so it needs a root shell or sudo. Otherwise it prints You have to be superuser to run this and exits 10.
- The spooler must be stopped. Otherwise it prints It looks like the scheduler is running, please stop first and exits 10.
- The licence file must be readable, or absent. If it is absent the program creates it, so no previous licence is needed. If it exists but is too short to hold a complete licence record, the program prints Cannot read val code??? and exits 4 without writing anything.
A stopped spooler is detected by the absence of its request socket. After a crash or a SIGKILL the socket file can be left behind, and the program then refuses although nothing is running. Clear the leftover socket and shared memory with xt-ripc -d first, then run the command again.
Writing the licence
Stop the product:
sstop -y
Write the emergency licence:
# Non-networked
xt-emerglic -L
# Networked
xt-emerglic -N
The command prints the period it has written:
Your copy is licensed from 12/08/2026 to 20/08/2026
With no option, the program guesses whether a network licence is needed and asks you to confirm. It answers "yes" only if /etc/xi/text-hosts exists and all four of the Xi-Text service entries - xitext, spq, xtnetsrv and xtapi - are present in the system services database. Any one missing and it defaults to "no".
xt-emerglic
Network licence required? [N]
If the existing licence is still valid, the program asks before replacing it, and the default answer is no:
Licence seems to be valid - continue? [N]
Answering N (or pressing return) leaves the licence untouched and exits 100.
Restart the product the way your system normally starts it. The shipped service unit runs:
spstart 2000 50
The options
| Option | Meaning |
|---|---|
| -L | Local licence - no network use |
| -N | Network licence |
| none | Guess, and prompt for confirmation |
There are no other options. xt-emerglic accepts one argument only. A second argument produces Usage: xt-emerglic [-L/N] and exit 200.
The Xi-Batch command accepts a second argument and ignores it, so a command line copied from an Xi-Batch procedure fails here. An argument that does not begin with a hyphen is ignored, and you are prompted instead.
The period is seven days and cannot be varied
The end date is set seven days ahead of midday UTC on the day you run the command; the start date is set to midday UTC on the previous day, so a clock that is slightly out leaves the licence valid from the moment it is written. The seven days are fixed, and no option, environment variable or configuration setting changes them.
Confirming what was written
xt-checklic
A successful check prints, with the fields separated by tabs:
Licensed to: Emergency Licence of Xi-Text
Serial is: 4173
Start time: 11/08/2026
End time: 20/08/2026
Validated for networks
***Emergency licence***
The ***Emergency licence*** line identifies it. The site name is fixed text, and the serial number is generated locally and has no meaning outside the machine. Validated for networks appears only if -N was used or the prompt was answered yes.
From four days before the end date, the check adds:
*** NOTE: Licence about to expire ***
The only warning is in spq
The only warning the product displays is in the interactive queue manager, spq, and its X11 equivalent. It appears once when the program starts, and needs a keystroke to clear:
***WARNING - Your emergency licence will expire in 5 days***
Please call us as soon as possible to get a new licence!!!!!!
***************Please type any character to continue**************
It is shown between 10:00 and 18:00 UTC, Monday to Friday, so that it does not block an unattended overnight or weekend session. It is the whole of the warning the product gives: the report file records nothing, no mail is sent, and jobs, printers and command-line programs run without comment. Where nobody at the site uses spq during working hours, the expiry arrives with no notice. Put the end date in a diary.
What happens when it expires
The licence check returns "expired" and the spooler exits instead of starting. From the next restart onwards the machine has no print spooling, and that includes the next restart of a spooler still running on the expired licence.
Plan to have the permanent licence installed and verified with several days in hand.
Replacing it with a permanent licence
A permanent licence is issued against your serial number through the Xi Software customer portal, and installed with xt-vwrite. Installing it overwrites the emergency licence in the same file; there is nothing to remove first.
sstop -y
xt-vwrite
spstart 2000 50
xt-checklic
Check that the output of the verification step names your organisation rather than Emergency Licence of…, and that the ***Emergency licence*** line has gone.
Licence codes issued by the portal expire twelve hours after they are generated, so obtain the code at the time you intend to install it. xt-vwrite refuses to run while the product is up, and exits 10 if it finds the spooler running.
Where the seven days are running out and the permanent licence is still unavailable, contact Xi Software and say so.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Emergency licence written |
| 4 | Existing licence file too short to read |
| 10 | Not root, spooler running, or the licence file could not be opened or created |
| 100 | Existing licence is valid and you declined to replace it |
| 200 | Too many arguments |
Where it goes wrong
Running it with the product still up. The command refuses and exits 10. Stop the product first.
# Refused
xt-emerglic -N
It looks like the scheduler is running, please stop first
# Correct
sstop -y
xt-emerglic -N
spstart 2000 50
Using the other product's command. On a machine running both products, xt-emerglic licences Xi-Text and xb-emerglic licences Xi-Batch. Running the wrong one leaves the product you meant to fix exactly as it was.
Forgetting to restart. The command writes a file; the licence is read when the spooler starts. Until you restart, nothing has changed for the running system.
Related articles
Migrating Xi-Text to Another System
Exporting the print queue, printers and users with xt-backup, and restoring them on a newly licensed machine
Renewing an Xi-Text Licence Without an Operator
Scheduling the stop, running xt-vwrite non-interactively, reading xt-checklic, and what the exit statuses mean
Installing an Emergency Seven-Day Licence on Xi-Batch
Recovering a system whose licence has been lost or damaged with xb-emerglic, and replacing it with a permanent licence