Managing Resin on Ubuntu

From Resin 4.0 Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "When I new release of Resin comes out, I often want to test out that some getting started tutorials are up to date and working as advertised. In order to do this, I like to c...")
 
 
Line 1: Line 1:
When I new release of Resin comes out, I often want to test out that some getting started tutorials are up to date and working as advertised.
 
  
In order to do this, I like to completely remove Resin off of one of my Ubuntu instances. These steps should also work with Debian.
+
What follows is a list of things that you can do to manage an install of Resin on Debian/Ubuntu.
  
 
=Is Resin installed with apt-get or Debian package manager?=
 
=Is Resin installed with apt-get or Debian package manager?=
Line 89: Line 88:
 
To see what Resin installs in usr/local/share you can do this:
 
To see what Resin installs in usr/local/share you can do this:
  
'''Output'''
+
 
 
<pre>
 
<pre>
 
$ dpkg -L resin-pro  | grep /usr/local
 
$ dpkg -L resin-pro  | grep /usr/local
 +
</pre>
 +
 +
 +
'''Output'''
 +
<pre>
 
/usr/local
 
/usr/local
 
/usr/local/share
 
/usr/local/share
Line 128: Line 132:
  
 
<pre>
 
<pre>
 
 
$ dpkg -L resin-pro  | grep -v "/www/doc"
 
$ dpkg -L resin-pro  | grep -v "/www/doc"
 
 
</pre>
 
</pre>
  
Line 201: Line 203:
 
/var/www/webapps
 
/var/www/webapps
 
/var/www/licenses
 
/var/www/licenses
 +
</pre>
 +
 +
=Installing a new version of Resin on Ubuntu/Debian=
 +
 +
The package manager has to find the new version first and it does this by doing an update.
 +
 +
<pre>
 +
$ sudo apt-get update
 +
</pre>
 +
 +
If there is a specific version of Resin that you want, you can do this:
 +
 +
<pre>
 +
$ sudo apt-get install resin-pro="4.0.27"
 +
</pre>
 +
 +
If you just want the lastest, you can do this:
 +
 +
<pre>
 +
$ sudo apt-get install resin-pro
 +
</pre>
 +
 +
=Two ways to uninstall=
 +
 +
When a new release of Resin comes out, I often want to test out that some getting started tutorials are up to date and working as advertised.
 +
 +
In order to do this, I like to completely remove Resin off of one of my Ubuntu instances. These steps should also work with Debian.
 +
 +
For most users, installing a new version of Resin on an existing Resin should be fine.
 +
Since I am testing out the getting started guides to Resin, I really need to wipe out Resin
 +
and install fresh.
 +
 +
apt-get remove resin-pro will remove Resin but leave the configurations files.
 +
apt-get --purge remove will remove Resin and all of its configuration.
 +
 +
A remove will look like this:
 +
 +
<pre>
 +
$ sudo apt-get remove resin-pro
 +
</pre>
 +
 +
'''Output'''
 +
<pre>
 +
Reading package lists... Done
 +
Building dependency tree     
 +
Reading state information... Done
 +
The following package was automatically installed and is no longer required:
 +
  libssl0.9.8
 +
Use 'apt-get autoremove' to remove them.
 +
The following packages will be REMOVED:
 +
  resin-pro
 +
0 upgraded, 0 newly installed, 1 to remove and 249 not upgraded.
 +
After this operation, 0 B of additional disk space will be used.
 +
Do you want to continue [Y/n]? Y
 +
(Reading database ... 141966 files and directories currently installed.)
 +
Removing resin-pro ...
 +
Removing any system startup links for /etc/init.d/resin ...
 +
  /etc/rc0.d/K10resin
 +
  /etc/rc1.d/K10resin
 +
  /etc/rc2.d/S90resin
 +
  /etc/rc3.d/S90resin
 +
  /etc/rc4.d/S90resin
 +
  /etc/rc5.d/S90resin
 +
  /etc/rc6.d/K10resin
 +
* Stopping resin                                                                                                  [ OK ]
 +
 +
Processing triggers for ureadahead ...
 +
 +
</pre>
 +
 +
The problem with this for testing a tutorial is that files still linger about as follows:
 +
 +
<pre>
 +
rick@ubuntu:~$ ls /etc/resin
 +
 +
app-default.xml  cluster-default.xml  health.xml  resin.xml
 +
 +
rick@ubuntu:~$ cd /etc/init.d/resin
 +
 +
bash: cd: /etc/init.d/resin: Not a directory
 +
 +
rick@ubuntu:~$ ls /usr/local/share/resin*
 +
ls: cannot access /usr/local/share/resin*: No such file or directory
 +
 +
rick@ubuntu:~$ ls /var/log/resin/
 +
console.log    jvm-app-0.log.20120303.2030  jvm-app-0.log.20120309.1757  jvm-app-0.log.20120316.1323  watchdog-manager.log
 +
jvm-app-0.log  jvm-app-0.log.20120306.1431  jvm-app-0.log.20120313.1823  jvm-app-0.log.20120320.1151
 +
 +
rick@ubuntu:~$ ls /var/www/*
 +
/var/www/doc:
 +
admin  resin-doc
 +
 +
/var/www/log:
 +
access.log.20120303
 +
 +
/var/www/resin-data:
 +
app-0  app-0.cache
 +
 +
/var/www/watchdog-data:
 +
app-0
 +
 +
/var/www/webapps:
 +
blog  ROOT
 +
 +
</pre>
 +
 +
 +
The configuration directory, the www directory and the log directory don't get removed.
 +
 +
Also purge option does not purge if those directories are not empty either.
 +
 +
<pre>
 +
$ sudo apt-get --purge remove resin-pro
 +
Reading package lists... Done
 +
Building dependency tree     
 +
Reading state information... Done
 +
The following package was automatically installed and is no longer required:
 +
  libssl0.9.8
 +
Use 'apt-get autoremove' to remove them.
 +
The following packages will be REMOVED:
 +
  resin-pro*
 +
0 upgraded, 0 newly installed, 1 to remove and 249 not upgraded.
 +
After this operation, 0 B of additional disk space will be used.
 +
Do you want to continue [Y/n]? y
 +
(Reading database ... 141966 files and directories currently installed.)
 +
Removing resin-pro ...
 +
Removing any system startup links for /etc/init.d/resin ...
 +
  /etc/rc0.d/K10resin
 +
  /etc/rc1.d/K10resin
 +
  /etc/rc2.d/S90resin
 +
  /etc/rc3.d/S90resin
 +
  /etc/rc4.d/S90resin
 +
  /etc/rc5.d/S90resin
 +
  /etc/rc6.d/K10resin
 +
* Stopping resin                                                                                                  [ OK ]
 +
Purging configuration files for resin-pro ...
 +
dpkg: warning: while removing resin-pro, directory '/usr/local/share' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/doc/admin/WEB-INF' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/doc/admin' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/doc/resin-doc/WEB-INF' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/doc/resin-doc' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/doc' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/webapps/ROOT' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www/webapps' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/www' not empty so not removed.
 +
dpkg: warning: while removing resin-pro, directory '/var/log/resin' not empty so not removed.
 +
Processing triggers for ureadahead ...
 +
</pre>
 +
 +
Purge can only delete files that it installed. So if the file is not listed in the package install, it can't delete it.
 +
 +
A little extra clean up after doing a remove purge is needed:
 +
<pre>
 +
$ sudo rm -rf /var/www
 +
rick@ubuntu:~$ sudo rm -rf /var/log/resin
 +
</pre>
 +
 +
Then we check to see if any remnants of Resin remain
 +
 +
<pre>
 +
rick@ubuntu:~$ ls /etc/resin
 +
ls: cannot access /etc/resin: No such file or directory
 +
 +
rick@ubuntu:~$ ls /etc/init.d/resin
 +
ls: cannot access /etc/init.d/resin: No such file or directory
 +
 +
rick@ubuntu:~$ ls /usr/local/share/resin*
 +
ls: cannot access /usr/local/share/resin*: No such file or directory
 +
 +
$ ls /usr/bin/resin*
 +
ls: cannot access /usr/bin/resin*: No such file or directory
 +
 +
</pre>
 +
 +
At this point, there is no Resin on the box and you can do a clean install.
 +
 +
<pre>
 +
$ sudo apt-get install resin-pro
 
</pre>
 
</pre>

Latest revision as of 00:00, 26 March 2012

What follows is a list of things that you can do to manage an install of Resin on Debian/Ubuntu.

Contents

Is Resin installed with apt-get or Debian package manager?

To see if Resin is installed at all, do this:


$ dpkg --get-selections | grep resin


Output

resin-pro					install

What version of Resin is installed?

To see what version of Resin you are running, you can do this:

$ dpkg -l | grep resin-pro

Output

ii  resin-pro                              4.0.26                                  Resin application server

Or this if Resin is running:

$ resinctl status

Output

Resin/4.0.26 status for watchdog at 127.0.0.1:6600

watchdog:
  watchdog-pid: 19766

server 'app-0' : ACTIVE
  password: missing
  watchdog-user: root
  user: www-data(www-data)
  root: /var/www
  conf: /etc/resin/resin.xml
  pid: 27326
  uptime: 25 days 16h21


See what Installs with Resin

To see what files are part of this version of Resin do this.

$ dpkg -L resin-pro  

This list is very long so if you wanted to see what Resin puts in /etc you could do this:

$ dpkg -L resin-pro  | grep /etc

Output

/etc
/etc/init.d
/etc/init.d/resin
/etc/resin
/etc/resin/resin.xml
/etc/resin/cluster-default.xml
/etc/resin/app-default.xml
/etc/resin/resin.properties
/etc/resin/resin-inf
/etc/resin/health.xml

To see what Resin installs in usr/local/share you can do this:


$ dpkg -L resin-pro  | grep /usr/local


Output

/usr/local
/usr/local/share
/usr/local/share/resin-pro-4.0.26
/usr/local/share/resin-pro-4.0.26/bin
/usr/local/share/resin-pro-4.0.26/bin/resin.sh
/usr/local/share/resin-pro-4.0.26/bin/resinctl
/usr/local/share/resin-pro-4.0.26/bin/resinctl.in
/usr/local/share/resin-pro-4.0.26/libexec64
/usr/local/share/resin-pro-4.0.26/libexec64/libresin_os.so
/usr/local/share/resin-pro-4.0.26/libexec64/libresin.so
/usr/local/share/resin-pro-4.0.26/LICENSE
/usr/local/share/resin-pro-4.0.26/webapp-jars
/usr/local/share/resin-pro-4.0.26/webapp-jars/hibernate-validator-4.0.2.GA.jar
/usr/local/share/resin-pro-4.0.26/webapp-jars/slf4j-api-1.6.1.jar
/usr/local/share/resin-pro-4.0.26/lib
/usr/local/share/resin-pro-4.0.26/lib/webservices-api.jar
/usr/local/share/resin-pro-4.0.26/lib/webservices.LICENSE
/usr/local/share/resin-pro-4.0.26/lib/resin-eclipselink.jar
/usr/local/share/resin-pro-4.0.26/lib/javaee-16.jar
/usr/local/share/resin-pro-4.0.26/lib/pro.jar
/usr/local/share/resin-pro-4.0.26/lib/webservices-extra-api.jar
/usr/local/share/resin-pro-4.0.26/lib/activation.jar
/usr/local/share/resin-pro-4.0.26/lib/resin.jar
/usr/local/share/resin-pro-4.0.26/lib/webutil.jar
/usr/local/share/resin-pro-4.0.26/lib/eclipselink-2.3.0.jar
/usr/local/share/resin-pro-4.0.26/lib/validation-api-1.0.0.GA.jar
/usr/local/share/resin-pro-4.0.26/lib/jsf-mojarra-2.1.3.jar
/usr/local/share/resin-pro-4.0.26/lib/javamail-141.jar
/usr/local/share/resin-pro-4.0.26/keys
/usr/local/share/resin-pro-4.0.26/licenses
/usr/local/share/resin

I also find it useful to see what is installed sans the docs folder so you can pipe to grep -v (the -v means only show me stuff that does not match the pattern).

$ dpkg -L resin-pro  | grep -v "/www/doc"

Output

/.
/var
/var/log
/var/log/resin
/var/www
/var/www/webapps
/var/www/webapps/ROOT
/var/www/webapps/ROOT/favicon.ico
/var/www/webapps/ROOT/index.jsp
/var/www/licenses
/usr
/usr/bin
/usr/local
/usr/local/share
/usr/local/share/resin-pro-4.0.26
/usr/local/share/resin-pro-4.0.26/bin
/usr/local/share/resin-pro-4.0.26/bin/resin.sh
/usr/local/share/resin-pro-4.0.26/bin/resinctl
/usr/local/share/resin-pro-4.0.26/bin/resinctl.in
/usr/local/share/resin-pro-4.0.26/libexec64
/usr/local/share/resin-pro-4.0.26/libexec64/libresin_os.so
/usr/local/share/resin-pro-4.0.26/libexec64/libresin.so
/usr/local/share/resin-pro-4.0.26/LICENSE
/usr/local/share/resin-pro-4.0.26/webapp-jars
/usr/local/share/resin-pro-4.0.26/webapp-jars/hibernate-validator-4.0.2.GA.jar
/usr/local/share/resin-pro-4.0.26/webapp-jars/slf4j-api-1.6.1.jar
/usr/local/share/resin-pro-4.0.26/lib
/usr/local/share/resin-pro-4.0.26/lib/webservices-api.jar
/usr/local/share/resin-pro-4.0.26/lib/webservices.LICENSE
/usr/local/share/resin-pro-4.0.26/lib/resin-eclipselink.jar
/usr/local/share/resin-pro-4.0.26/lib/javaee-16.jar
/usr/local/share/resin-pro-4.0.26/lib/pro.jar
/usr/local/share/resin-pro-4.0.26/lib/webservices-extra-api.jar
/usr/local/share/resin-pro-4.0.26/lib/activation.jar
/usr/local/share/resin-pro-4.0.26/lib/resin.jar
/usr/local/share/resin-pro-4.0.26/lib/webutil.jar
/usr/local/share/resin-pro-4.0.26/lib/eclipselink-2.3.0.jar
/usr/local/share/resin-pro-4.0.26/lib/validation-api-1.0.0.GA.jar
/usr/local/share/resin-pro-4.0.26/lib/jsf-mojarra-2.1.3.jar
/usr/local/share/resin-pro-4.0.26/lib/javamail-141.jar
/usr/local/share/resin-pro-4.0.26/keys
/usr/local/share/resin-pro-4.0.26/licenses
/etc
/etc/init.d
/etc/init.d/resin
/etc/resin
/etc/resin/resin.xml
/etc/resin/cluster-default.xml
/etc/resin/app-default.xml
/etc/resin/resin.properties
/etc/resin/resin-inf
/etc/resin/health.xml
/usr/bin/resinctl
/usr/local/share/resin

The main areas we need to look at for an uninstall:

/etc/resin
/etc/init.d/resin
/usr/bin/resinctl
/usr/local/share/resin-pro-4.0.26
/var/log/resin
/var/www/webapps
/var/www/licenses

Installing a new version of Resin on Ubuntu/Debian

The package manager has to find the new version first and it does this by doing an update.

$ sudo apt-get update

If there is a specific version of Resin that you want, you can do this:

$ sudo apt-get install resin-pro="4.0.27"

If you just want the lastest, you can do this:

$ sudo apt-get install resin-pro

Two ways to uninstall

When a new release of Resin comes out, I often want to test out that some getting started tutorials are up to date and working as advertised.

In order to do this, I like to completely remove Resin off of one of my Ubuntu instances. These steps should also work with Debian.

For most users, installing a new version of Resin on an existing Resin should be fine. Since I am testing out the getting started guides to Resin, I really need to wipe out Resin and install fresh.

apt-get remove resin-pro will remove Resin but leave the configurations files. apt-get --purge remove will remove Resin and all of its configuration.

A remove will look like this:

$ sudo apt-get remove resin-pro 

Output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libssl0.9.8
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  resin-pro
0 upgraded, 0 newly installed, 1 to remove and 249 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 141966 files and directories currently installed.)
Removing resin-pro ...
 Removing any system startup links for /etc/init.d/resin ...
   /etc/rc0.d/K10resin
   /etc/rc1.d/K10resin
   /etc/rc2.d/S90resin
   /etc/rc3.d/S90resin
   /etc/rc4.d/S90resin
   /etc/rc5.d/S90resin
   /etc/rc6.d/K10resin
 * Stopping resin                                                                                                   [ OK ] 

Processing triggers for ureadahead ...

The problem with this for testing a tutorial is that files still linger about as follows:

rick@ubuntu:~$ ls /etc/resin

app-default.xml  cluster-default.xml  health.xml  resin.xml

rick@ubuntu:~$ cd /etc/init.d/resin

bash: cd: /etc/init.d/resin: Not a directory

rick@ubuntu:~$ ls /usr/local/share/resin*
ls: cannot access /usr/local/share/resin*: No such file or directory

rick@ubuntu:~$ ls /var/log/resin/
console.log    jvm-app-0.log.20120303.2030  jvm-app-0.log.20120309.1757  jvm-app-0.log.20120316.1323  watchdog-manager.log
jvm-app-0.log  jvm-app-0.log.20120306.1431  jvm-app-0.log.20120313.1823  jvm-app-0.log.20120320.1151

rick@ubuntu:~$ ls /var/www/*
/var/www/doc:
admin  resin-doc

/var/www/log:
access.log.20120303

/var/www/resin-data:
app-0  app-0.cache

/var/www/watchdog-data:
app-0

/var/www/webapps:
blog  ROOT


The configuration directory, the www directory and the log directory don't get removed.

Also purge option does not purge if those directories are not empty either.

$ sudo apt-get --purge remove resin-pro 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libssl0.9.8
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  resin-pro*
0 upgraded, 0 newly installed, 1 to remove and 249 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 141966 files and directories currently installed.)
Removing resin-pro ...
 Removing any system startup links for /etc/init.d/resin ...
   /etc/rc0.d/K10resin
   /etc/rc1.d/K10resin
   /etc/rc2.d/S90resin
   /etc/rc3.d/S90resin
   /etc/rc4.d/S90resin
   /etc/rc5.d/S90resin
   /etc/rc6.d/K10resin
 * Stopping resin                                                                                                   [ OK ] 
Purging configuration files for resin-pro ...
dpkg: warning: while removing resin-pro, directory '/usr/local/share' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/doc/admin/WEB-INF' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/doc/admin' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/doc/resin-doc/WEB-INF' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/doc/resin-doc' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/doc' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/webapps/ROOT' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www/webapps' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/www' not empty so not removed.
dpkg: warning: while removing resin-pro, directory '/var/log/resin' not empty so not removed.
Processing triggers for ureadahead ...

Purge can only delete files that it installed. So if the file is not listed in the package install, it can't delete it.

A little extra clean up after doing a remove purge is needed:

$ sudo rm -rf /var/www
rick@ubuntu:~$ sudo rm -rf /var/log/resin

Then we check to see if any remnants of Resin remain

rick@ubuntu:~$ ls /etc/resin
ls: cannot access /etc/resin: No such file or directory

rick@ubuntu:~$ ls /etc/init.d/resin
ls: cannot access /etc/init.d/resin: No such file or directory

rick@ubuntu:~$ ls /usr/local/share/resin*
ls: cannot access /usr/local/share/resin*: No such file or directory

$ ls /usr/bin/resin*
ls: cannot access /usr/bin/resin*: No such file or directory

At this point, there is no Resin on the box and you can do a clean install.

$ sudo apt-get install resin-pro 
Personal tools
TOOLBOX
LANGUAGES