<!-- 
<!DOCTYPE RefEntry PUBLIC "-//Davenport//DTD DocBook V2.4.1//EN">
Copyright (c) 2003 James Lowe, Jr.
Permission is granted to copy, distribute and/or modify this document 
under the terms of the GNU Free Documentation License, Version 1.1 or any 
later version published by the Free Software Foundation; with no Invariant 
Sections, with no Front-Cover Texts, and with no Back-Cover Texts.

     Formatting Instructions: 
      $ docbook-to-man swremove_8.sgml | nroff -man 

     docbook-to-man is a free, copyrighted tool that can be obtained from
     many sgml oriented sites.
-- >
<!DOCTYPE form
[
<!ENTITY swtarget SYSTEM "target.sgml">
<!ENTITY version SYSTEM "version.sgml">
]>
<REFENTRY>
<REFMETA>
<REFENTRYTITLE>
swremove
</REFENTRYTITLE>
<MANVOLNUM>8</MANVOLNUM> 
<REFMISCINFO>
swremove - Software Administration
</REFMISCINFO>
</REFMETA>

<REFNAMEDIV>
<REFNAME>
swremove
</REFNAME>
<REFPURPOSE>
Remove installed software
</REFPURPOSE>
</REFNAMEDIV>
<REFSYNOPSISDIV>
<SYNOPSIS>
<FUNCTION>swremove</FUNCTION>  <OPTIONAL>-d|-r</OPTIONAL> <OPTIONAL>-v</OPTIONAL> <OPTIONAL>-t <REPLACEABLE>targetfile</REPLACEABLE></OPTIONAL> \\
<OPTIONAL>-x <REPLACEABLE>option=value</REPLACEABLE></OPTIONAL>  <OPTIONAL>-X <REPLACEABLE>options_file</REPLACEABLE></OPTIONAL>  <OPTIONAL>-W <REPLACEABLE>option</REPLACEABLE></OPTIONAL> \\
<OPTIONAL>software_selections</OPTIONAL>  <OPTIONAL>@targets</OPTIONAL> 
</SYNOPSIS>
<SYNOPSIS>
<FUNCTION>swremove</FUNCTION> --cleansh <OPTIONAL>options</OPTIONAL> <OPTIONAL>@targets</OPTIONAL>
</SYNOPSIS>
</REFSYNOPSISDIV>

<REFSECT1 ID="R1 swremove">
<TITLE>
DESCRIPTION
</TITLE>
<PARA>
<FUNCTION>swremove</FUNCTION> removes installed software.
<FUNCTION>swremove</FUNCTION> is a distributed utility.
Neither swremove nor any component of swbis is required
on the target host, however, the target host must look like a Unix system at
the shell and command-line utility level.  Remote network connections are made
by ssh.  Ssh is the default but rsh can be selected by a command line
option.
</PARA>
<PARA>
<FUNCTION>swremove</FUNCTION>
operates on installed software identified by a <REPLACEABLE>software selection</REPLACEABLE>
and <REPLACEABLE>target</REPLACEABLE>.
</PARA>

</REFSECT1>
<REFSECT1>
<TITLE>
OPTIONS
</TITLE>
<PARA>
<GLOSSLIST>
<GLOSSLIST> 
</PARA>

<PARA>
<OPTION>-d</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify the target is a distribution. 
<NOTE>
This is currently not supported by this implementation.
</NOTE>
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-f FILE</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Read the list of software selections from FILE.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-p</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Preview mode, establish contact with target host, however, modify nothing.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-r</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Indicates that the operation is on installed software at a location indicated by the the target. 
<NOTE>
This is the default mode among -d and -r
</NOTE>
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-t targetfile</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify a file containing a list of targets (one per line).
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-v</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Increment the verbose level.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-x option=value</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify the extended option overriding the defaults file value.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-X FILE</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify the extended options filename, FILE,  overriding the default filenames.
This option may be given more then once. If the resulting specified value is an empty string
then reading of any options file is disabled.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>\-\-help</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Show help (Implementation extension)
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W option[,option,...]</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify the implementation extension option.<SBR>
Syntax: -W option[=option_argument[,option...]<SBR>
Options may be separated by a comma.  The implementation extension
options may also be given individually using the '\-\-long-option[=option_arg]' syntax.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>--allow-ambig</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Allows swremove to act on all matching entries.  Without this option
a software selection that matches more than one installed software entry
is an error.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>--sig-level=N</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Specify number of required GPG signatures, N equal to 0 means don't
require the catalog to be signed.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>--cleansh</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Kill stray or zombied processes that match the pattern ``sh -s.*_swbis''.  These
may be caused by a distributed utility segfaulting or a signal handling defect in the
swbis utility.
</GLOSSLIST>
</GLOSSLIST>
</PARA>

<PARA>
<OPTION>-W remote-shell=SHELL</OPTION> 
<GLOSSLIST>
<GLOSSLIST> 
Defaults File Option: <OPTION>swbis_remote_shell_client</OPTION><SBR>
Supported shells are "ssh" and "rsh", ssh is the default.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W show-options-files</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Show the complete list of options files and if they are found.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W show-options</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Show the options after reading the files and parsing the command line options.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W pax-command={tar|pax|star|gtar}</OPTION><SBR>
<GLOSSLIST>
<GLOSSLIST>
Set the portable archive command for all operations.
The default is "pax".
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W pax-read-command={tar|pax|star|gtar}</OPTION>
<GLOSSLIST><GLOSSLIST>
Set the read command for local and remote hosts.
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W remote-pax-read-command={tar|pax|star|gtar}</OPTION>
<GLOSSLIST><GLOSSLIST>
Defaults File Option: <OPTION>swbis_remote_pax_read_command</OPTION>
</GLOSSLIST></GLOSSLIST>
<GLOSSLIST><GLOSSLIST>
Set the read command for remote hosts.
This is the command that runs on the target (e.g. pax -r, tar xpf -).
The default is "pax".
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W local-pax-read-command={tar|pax|star|gtar}</OPTION>
<GLOSSLIST><GLOSSLIST>
Defaults File Option: <OPTION>swbis_local_pax_read_command</OPTION>
</GLOSSLIST></GLOSSLIST>
<GLOSSLIST><GLOSSLIST>
Set the read command for local hosts.
This is the command that runs on the target (e.g. pax -r, tar xpf -).
The default is "pax".
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W pax-write-command={tar|pax|star|gtar|swbistar}</OPTION><SBR>
<GLOSSLIST><GLOSSLIST>
Set the write command for local and remote hosts.
This is the command that runs on the target (e.g. pax -w, tar cf -).
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W remote-pax-write-command={tar|pax|star|gtar|swbistar}</OPTION><SBR>
<GLOSSLIST><GLOSSLIST>
Defaults File Option: <OPTION>swbis_remote_pax_write_command</OPTION>
</GLOSSLIST></GLOSSLIST>
<GLOSSLIST><GLOSSLIST>
Set the write command for remote hosts.
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W local-pax-write-command={tar|pax|star|gtar|swbistar}</OPTION>
<GLOSSLIST><GLOSSLIST>
Defaults File Option: <OPTION>swbis_local_pax_write_command</OPTION>
</GLOSSLIST></GLOSSLIST>
<GLOSSLIST><GLOSSLIST>
Set the portable archive write command for local host operations.
This is the command that runs on the source (e.g. pax -w, tar cf -).
The default is "pax".
</GLOSSLIST></GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W remote-pax-write-command={tar|pax|star|gtar|swbistar}</OPTION>
<GLOSSLIST><GLOSSLIST>
Defaults File Option: <OPTION>swbis_remote_pax_write_command</OPTION>
</GLOSSLIST></GLOSSLIST>
<GLOSSLIST><GLOSSLIST>
Set the portable archive write command for remote host operations.
This is the command that runs on the source (e.g. pax -w, tar cf -).
The default is "pax".
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W no-defaults</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Do not read any defaults files.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W no-getconf</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Defaults File Option: <OPTION>swbis_no_getconf</OPTION><SBR>
Makes the remote command be '/bin/sh -s' instead of the default
'PATH=`getconf PATH` sh -s'. 
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W shell-command=NAME</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Defaults File Option: <OPTION>swbis_shell_command</OPTION><SBR>
NAME may be one of "bash", "sh" or "posix" and specifies the
remote command run by the remote shell.
"posix" is 'PATH=`getconf PATH` sh -s', "bash" is "/bin/bash -s",
"sh" is "/bin/sh -s", and "ksh" is "ksh -s".
The default is "posix".
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W use-getconf</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Opposite of \-\-no-getconf.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
</PARA>
<PARA>
<OPTION>-W source-script-name=NAME</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Write the script that is written into the remote shell's stdin to NAME.
This is useful for debugging.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>-W target-script-name=NAME</OPTION> 
<GLOSSLIST>
<GLOSSLIST>
Write the script that is written into the remote shell's stdin to NAME.
This is useful for debugging.
</GLOSSLIST>
</GLOSSLIST>
</PARA>
<PARA>
<OPTION>software_selections</OPTION>
<GLOSSLIST>
<GLOSSLIST> 
Refer to the software objects (products, filesets)
using software spec syntax. (See sw(5) for syntax).
</GLOSSLIST>
</GLOSSLIST> 
</PARA>
<PARA>
<OPTION>target</OPTION>
<GLOSSLIST>
<GLOSSLIST> 
Refers to the software_collection where the software
selections are to be applied.
Allows specification of host and pathname where the software collection is located.
A target that contains only one part is assumed to be a hostname.
To force interpretation as a path, use a absolute path or prefix with ':'.
</GLOSSLIST>
</GLOSSLIST> 
</PARA>
&swtarget; 
</REFSECT1>

<REFSECT1>
<TITLE>
USAGE EXAMPLES
</TITLE>
<REFSECT2>
<TITLE>
Remove everything at 192.168.1.2 from the root directory
</TITLE>
<PROGRAMLISTING>
  swremove --allow-ambig \\* @ root@192.168.1.2:/
</PROGRAMLISTING>
</REFSECT2>

<REFSECT2>
<TITLE>
Preview removal of every package listing every file, but modify nothing
</TITLE>
<PROGRAMLISTING>
  swremove -vv -p --allow-ambig \\* @ root@192.168.1.2:/
</PROGRAMLISTING>
</REFSECT2>

<REFSECT2>
<TITLE>
Remove everything at 192.168.1.2 from the home directory of user 'jailbird'.
</TITLE>
<PROGRAMLISTING>
  swremove --allow-ambig \\* @ jailbird@192.168.1.2:.
</PROGRAMLISTING>
</REFSECT2>

<REFSECT2>
<TITLE>
Remove package foo from the root '/', or elevate your credentials via ssh
</TITLE>
<PROGRAMLISTING>
  swremove foo @ /
  swremove foo @ root@localhost:/
</PROGRAMLISTING>
</REFSECT2>


<REFSECT2>
<TITLE>
Show the options
</TITLE>
<PROGRAMLISTING>
  swremove --show-options
</PROGRAMLISTING>
</REFSECT2>
</REFSECT1>

<REFSECT1>
<TITLE>
EXTENDED OPTIONS
</TITLE>
<PARA>
Extended options can be specified on the command line using the -x option
or from the defaults file, swdefaults.  Shown below is an actual portion of
a defaults file which show default values.
</PARA>
<REFSECT2>
<TITLE>
POSIX
</TITLE>
<PARA>
These options are set in the /usr/lib/swbis/swdefaults or the ~/.swdefaults on
the local (management host, host where swremove is invoked).
These files on the target host are not used.
</PARA>
<PARA>
<VERB>
<PROGRAMLISTING>
  autoselect_dependencies       = false
  distribution_target_directory = /
  enforce_dependencies          = false
  enforce_scripts               = true
  installed_software_catalog    = var/lib/swbis/catalog/
  logfile                       = /var/log/sw.log
  loglevel                      = 1
  select_local                  = true
  verbose                       = 1
</PROGRAMLISTING>
</VERB>
</PARA>
</REFSECT2>
<REFSECT2>
<TITLE>
Swbis Implementation
</TITLE>
<PARA>
These options are set in the /usr/lib/swbis/swbisdefaults or the ~/.swbis/swbisdefaults
file. 
</PARA>
<PARA>
<VERB>
<PROGRAMLISTING>

  swremove.swbis_no_getconf = true # true or false
  swremove.swbis_shell_command = posix # {sh|bash|posix|ksh}
  swremove.swbis_no_remote_kill = false # true or false
  swremove.swbis_local_pax_write_command=tar #{pax|tar|star|gtar}
  swremove.swbis_remote_pax_write_command=tar #{pax|tar|star|gtar}
  swremove.swbis_local_pax_read_command=tar #{pax|tar|gtar|star}
  swremove.swbis_remote_pax_read_command=tar #{pax|tar|gtar|star}
  swremove.swbis_local_pax_remove_command=tar
  swremove.swbis_remote_pax_remove_command=tar
  swremove.swbis_remote_shell_client=ssh
  swremove.swbis_forward_agent=True
  swremove.swbis_sig_level=0
  swremove.swbis_enforce_all_signatures=false
</PROGRAMLISTING>
</VERB>
</PARA>
</REFSECT2>
</REFSECT1>
<REFSECT1>
<TITLE>
RETURN VALUE
</TITLE>
<PARA>
0 if all targets succeeded, 1 if all targets failed or internal error, 2 if some targets failed
and some succeeded.
</PARA>
</REFSECT1>
<REFSECT1>
<TITLE>
NOTES
</TITLE>
Multiple ssh-hops is an implementation extension.<SBR>
</REFSECT1>
<REFSECT1>
<TITLE>
REQUISITE UTILITIES
</TITLE>
<PARA>
The swbis distributed utilities require
<FUNCTION>bash</FUNCTION>, public domain <FUNCTION>ksh</FUNCTION>, or 
Sun's /usr/xpg4/bin/sh to be present on the target host.  If the
<FUNCTION>swbis_shell_command</FUNCTION> extended option is set to 'detect'
you don't have to know which one is present, otherwise you may specify one explicitly.
</PARA>
<PARA>
A POSIX <FILENAME>awk</FILENAME> is required, and with the ability to
specify several thousand bytes of program text as a command argument.
GNU awk  works, as does the ATT Awk book awk, and the awk on BSD systems.
See the INSTALL file for further details regarding a small issue with the
OpenSolaris (c.2006) awk.
</PARA>
<PARA>
GNU Privacy Guard, gpg is required for verification of package signatures.
</PARA>
<PARA>
swremove uses rm and rmdir for file and directory removal.
</PARA>
<PARA>
Other utilities required to be in $PATH on the remote host are:
dd, pax (or tar|star|gtar), mkdir, echo, test, sleep, read (if not builtin).
</PARA>
</REFSECT1>
<REFSECT1>
<TITLE>
FILES
</TITLE>
<PARA>
<VERB>
<PROGRAMLISTING>
/var/lib/swbis/catalog # Location of installed catalog
/usr/lib/swbis/swdefaults
/usr/lib/swbis/swbisdefaults
$HOME/.swbis/swdefaults
$HOME/.swbis/swbisdefaults
</PROGRAMLISTING>
</VERB>
</PARA>
</REFSECT1>

<REFSECT1>
<TITLE>
APPLICABLE STANDARDS
</TITLE>
<PARA>
ISO/IEC 15068-2:1999, Open Group CAE C701
</PARA>
</REFSECT1>
<REFSECT1>
<TITLE>
SEE ALSO
</TITLE>
<PARA>
info swbis
</PARA>
<PARA>
swbis(7), sw(5), swlist(8) 
</PARA>
</REFSECT1>
<REFSECT1>
<TITLE>
IDENTIFICATION
</TITLE>
<VERB>
 swremove(8): The package removal utility of the swbis project.
 Author: Jim Lowe   Email: jhlowe at acm.org
<!-- External Entity  --> &version;
Last Updated: 2008-04-18
 Copying: GNU Free Documentation License
</VERB>
</REFSECT1>
<REFSECT1>
<TITLE>
BUGS
</TITLE>
<PARA>
swremove is subject to breakage if a user's account on an intermediate
(or terminal) host in a target spec is not configured to use a Bourne
compatible shell. (This breakage may be eliminated by use of the 
--no-getconf option as explained above.)
</PARA>
swremove does not support rollback if an error occurs during processing.
</PARA>
</REFSECT1>
</REFENTRY>
