瀏覽代碼

Update for npm installation.

Jakob Borg 13 年之前
父節點
當前提交
5708534b97
共有 3 個文件被更改,包括 15 次插入21 次删除
  1. 10 16
      README.md
  2. 1 1
      zsnapper
  3. 4 4
      zsnapper.xml

+ 10 - 16
README.md

@@ -11,22 +11,15 @@ This is a ZFS snapshotting service for Solaris, OpenIndiana, SmartOS and friends
 Installation
 ============
 
-Unpack
-------
-
-Clone this repository (or unpack the download) into `/opt/nym/zsnapper`. Any
-other directory will do as well, but you will need to modify the SMF manifest
-to update the paths.
-
-Install dependencies
---------------------
-
-Run `npm install` in `/opt/nym/zsnapper`.
+    # npm -g install zsnapper
 
 Configure
 ---------
 
-Update the config file `zsnapper` conf with your desired snapshot configuration.
+Copy the config file `zsnapper.json.sample` (probably installed in
+`/usr/local/lib/node_modules/zsnapper` by npm) to
+`/etc/zsnapper.json` and update it with your desired configuration.
+
 It's a JSON file of the format:
 
     {
@@ -71,12 +64,13 @@ Start
 To test the setup, start the service (as root) with the name of the config file
 as the only parameter.
 
-    # /opt/nym/zsnapper/zsnapper /opt/nym/zsnapper/zsnapper.json
+    # /usr/local/bin/zsnapper /etc/zsnapper.json
 
 A better alternative, once everything seems to work as intended, is to use the
-accompanying SMF manifest. Edit `zsnapper.xml` to suit your installation
-(particularly the path to the `zsnapper` binary and `zsnapper.json` config
-file). Then import it:
+accompanying SMF manifest. Copy `zsnapper.xml` from
+`/usr/local/lib/node_modules/zsnapper` to your home directory and edit it to
+suit your installation. The only things you need to modify are the paths to the
+`zsnapper` executable and the `zsnapper.json` config file. Then import it:
 
     # svccfg import zsnapper.xml
 

+ 1 - 1
zsnapper

@@ -1,4 +1,4 @@
-#!/usr/bin/node
+#!/usr/bin/env node
 
 var _ = require('underscore');
 var async = require('async');

+ 4 - 4
zsnapper.xml

@@ -12,18 +12,18 @@
         <method_context>
         </method_context>
 
+	<exec_method type="method" name="start" exec="/usr/local/bin/zsnapper %{config_file}" timeout_seconds="60"/>
+        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
+
         <property_group name="startd" type="framework">
             <propval name="duration" type="astring" value="child"/>
             <propval name="ignore_error" type="astring" value="core,signal"/>
         </property_group>
 
         <property_group name="application" type="application">
-            <propval name="config_file" type="astring" value="/opt/nym/zsnapper/zsnapper.json"/>
+            <propval name="config_file" type="astring" value="/etc/zsnapper.json"/>
         </property_group>
         
-        <exec_method type="method" name="start" exec="/opt/nym/zsnapper/zsnapper %{config_file}" timeout_seconds="60"/>
-        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
-
         <stability value="Evolving"/>
 
         <template>