Getting snipsnap to work

I decided to move my SnipSnap (see here... on the net and here ...on my blog) from the windows partition to my Linux partition; my personal site runs on Linux & apache, and I'm pretty certain I want the sort of features products such as snipsnap offer.

So, I downloaded the tgz file and gunziped it. I began to edit the shell start up file, but discovered that my Fedora Version didn't have Java. This is a bit off, presumably a piece of Sun/Red Hat sectarianism. Anyway, its easy enough to solve. http://java.sun.com

Once we've got Java installed, Snipsnap runs. There is a two phase install, the first to create an instance and the second to configure it. The first phase involves reading from the console and then connecting to the server in order to configure the Snipsnap instance, including the admin user. It seems that certain configuration files are default written to ${HOME}/application and this is referenced from one of the .xml files in ${SNIPSNAP_ROOT}/conf. This warrants further research.

The host firewall had to have some rules written for it to permit remote query.

I then addressed the issue of configuring the snipsnap daemon as a server. I checked the Service Config Tool and this references the rc.d/init.d directories, so I quickly created a script to start, stop and restart the daemon. This failed to install because of chkconfig requires certain strings embedded in the scripts. Once it had these, documenting the run level and start & stop priority and a description field, the program installed as a service start/stop.

The stop function took a bit of care. The snipsnap shell invokes Java and so discovering the pid of the shell is pretty easy, but there may be several java instances running so we need to be certain that the jvm we kill is the snipsnap host. Often, people use a file to hold the pids, but I chose to use the linux pstree command which returns the child process names and pids of a given pid. I used pidof to translate the script name into a master pid, and good old cut to extract the pid from the pstree output.

pstree -p ${scriptpid} | cut -f3 -d\\( | cut -f-1 -d\\)

My two outstanding problems are the console displays and the log file management, but I'll fix them tomorrow.

11 Aug 2005. I returned to the problem and sorted out the two issues. The functions library has the necessary functions to conform to the service authoring rules. These are echo_success & echo_failure. The program snipsnapd now works quite nicely with the Service Config Tool, I'll have to try and get this working on Solaris 10 with an SMF manifest.

tags:

Comments:

Post a Comment:
Comments are closed for this entry.
About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today