~ubuntu-branches/ubuntu/quantal/zfs-fuse/quantal

« back to all changes in this revision

Viewing changes to debian/zfs-fuse.init

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey, Mike Hommey, Seth Heeren
  • Date: 2010-06-30 18:03:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100630180352-d3jq25ytbcl23q3y
Tags: 0.6.9-1
* New upstream release.

[ Mike Hommey ]
* debian/control:
  - Build depend on libssl-dev and libattr1-dev, now required to build.
  - Build depend on docbook-xml to avoid xsltproc I/O error loading
    docbook DTD.
  - Add suggestions for a NFS server and kpartx.
* debian/man/*, debian/copyright, debian/rules: Remove manual pages, they
  are now shipped upstream.
* debian/copyright: Change download link.
* src/SConstruct:
  - Add an optim option to the build system.
  - Add support for DESTDIR.
  - Force debug=1 to mean optim, no strip, no debug.
  - Use -ffunction-sections, -fdata-sections, and --gc-sections flags to
    reduce the binary sizes.
* src/lib/libumem/SConscript: Cleanup src/lib/libumem when cleaning up
  build directory.
* src/cmd/*/SConscript: Don't link zfs, zpool and zdb against libssl.
* src/lib/libumem/SConscript: Only build static libumem.
* src/lib/libumem/sol_compat.h:
  - Add atomic cas support for sparc.
  - Use atomic functions from libsolcompat in libumem on unsupported
    platforms.
* debian/rules:
  - Set optimization level in build system according to DEB_BUILD_OPTIONS.
  - Build with debug=1 to have unstripped binaries ; dh_strip will do the
    right thing.
  - Don't depend on the local location of the docbook XSLT stylesheets.
    Use the catalogged url in place of the full path.
  - Don't clean src/.sconsign.dblite and src/path.pyc.
  - Set all destination directories when installing with scons.
  - Install bash completion and zfsrc files.
  - Don't use scons cache when building.
* debian/prerm: Remove /var/lib/zfs/zpool.cache in prerm.
* debian/dirs: Create /etc/bash_completion.d.
* debian/watch: Fix watch file.
* debian/rules, debian/control, debian/compat: Switch to dh.
* debian/README.Debian: Update README.Debian.
* debian/zfs-fuse.man.xml: Update zfs-fuse manual page.
* debian/zfs-fuse.init: Start sharing datasets marked as such at daemon
  startup.
* debian/rules, debian/control: Use config.guess and config.sub from
  autotools-dev.

[ Seth Heeren ]
* debian/zfs-fuse.man.xml:
  Added notes on the precedence, zfsrc, commandline, initscript vs.
  /etc/default/zfs-fuse on some systems.
* debian/zfs-fuse.init, debian/zfs-fuse.default: Deprecating DAEMON_OPTS.
* debian/zfs-fuse.init:
  - Removing import -a -f.
  - Removing the now unnecessary 'sleep 2'.
  - Extended shutdown wait to allow for zfs-fuse daemon's own shutdown
    timeouts.
  - Re-ordered dubious PATH setting.
* debian/zfs-fuse.init: Move existing zpool.cache to new location if
  possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
set -u # Error on uninitialized variabled
15
15
set -e # Error on uncaught non-zero exit codes
16
16
 
17
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
17
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
18
18
DAEMON=/sbin/zfs-fuse
19
19
NAME=zfs-fuse
20
20
DESC=zfs-fuse
21
21
ENABLE_ZFS=yes
22
 
DAEMON_OPTS=""
 
22
DAEMON_OPTS="" # deprecated, please refer to /etc/zfs/zfsrc for your tuning
 
23
               # needs
23
24
RESTART_ON_UPGRADE=no
24
25
 
25
26
### Fallback functions in case lsb-base isn't available (eg in postinst)
53
54
 
54
55
FORCE_STOP=no
55
56
 
 
57
upgrade_zpool_cache_location()
 
58
{
 
59
        oldcache=/etc/zfs/zpool.cache      # this changed per 0.6.9, only needed when upgrading from earlier versions
 
60
        newcache=/var/lib/zfs/zpool.cache
 
61
 
 
62
        if [[ -f $oldcache && ! -e $newcache ]]; then
 
63
                log_action_msg "Moving existing zpool.cache to new location"
 
64
                mkdir -p $(dirname $newcache)
 
65
                mv $oldcache $newcache
 
66
        else
 
67
                if [ -e $oldcache ]; then
 
68
                        log_action_msg "Note: old zpool.cache present but no longer used ($oldcache)"
 
69
                fi
 
70
        fi
 
71
}
 
72
 
56
73
is_running() {
57
74
    ### XXX: this produces output for some reason
58
75
        start-stop-daemon --stop --test --quiet --pidfile \
76
93
        if start-stop-daemon --stop --quiet --pidfile \
77
94
            /var/run/$NAME.pid --exec $DAEMON
78
95
        then
79
 
            ## wait for it to stop, up to 10 seconds
 
96
            ## wait for it to stop, up to 12 seconds
 
97
            ## 10 seconds is the wait time for worker threads to complete their
 
98
            ## work before the daemon forcibly terminates them and completes
 
99
            ## shutdown 
80
100
            COUNTER=0
81
101
            while is_running; do
82
102
                sleep 1
83
 
                COUNTER=`expr $COUNTER + 1`
84
 
                if [ $COUNTER = 10 ]; then
 
103
                COUNTER=$(($COUNTER + 1))
 
104
                if [ $COUNTER -ge 12 ]; then
85
105
                    log_end_msg 1 "Timed out"
86
106
                    exit 1
87
107
                fi
103
123
        return 1
104
124
    fi
105
125
    if [ "x$ENABLE_ZFS" != "xyes" ]; then
106
 
        log_action_msg "disabled by /etc/default/$NAME" >&2
 
126
        log_action_msg "Disabled by /etc/default/$NAME" >&2
107
127
        return 1
108
128
    fi
 
129
        upgrade_zpool_cache_location
109
130
    log_daemon_msg "Starting $NAME" "zfs-fuse"
110
131
    ulimit -v unlimited
111
132
    ulimit -c 512000
126
147
          exit 3
127
148
        fi
128
149
        log_action_begin_msg "Mounting ZFS filesystems"
129
 
        sleep 2 # allow zfs-fuse time to start up
130
 
        zpool import -a -f
131
150
        if zfs mount -a
132
 
        then log_action_end_msg 0; return 0
 
151
        then zfs share -a; log_action_end_msg 0; return 0
133
152
        else log_action_end_msg 1; return 1
134
153
        fi
135
154
    else