~ubuntu-branches/ubuntu/quantal/lsb/quantal-proposed

« back to all changes in this revision

Viewing changes to init-functions

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek, Jeff Licquia
  • Date: 2009-06-02 20:20:07 UTC
  • mfrom: (1.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090602202007-yrfljcu970v0kcqd
Tags: 4.0-0ubuntu1
* Merge from Debian unstable, remaining changes:
  - lsb-base-logging-ubuntu.sh: change log_{success,warning,failure}_msg()
    to use usplash_write "TEXT" instead of "STATUS" to avoid unreadable
    line-wrapping when using usplash in verbose mode.
  - Don't conflict with python (>= 2.6).
  - Depend on postfix rather than exim4 as preferred mail-transport-agent
    alternative.
  - Depend on libgl1-mesa-glx rather than libgl1-mesa as preferred libgl1
    alternative.
  - Since /etc/lsb-release overrides detected information, there's no
    need to try and detect that information if lsb-release contains
    everything we need.  This saves us calling the hugely expensive
    apt-cache.
  - Add Ubuntu logging functions.

[ Jeff Licquia ]
* Upgrade to support LSB 4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
 
30
30
start_daemon () {
31
 
    local force nice pidfile exec i
 
31
    local force nice pidfile exec i args
32
32
    force=0
33
33
    nice=0
34
34
    pidfile=/dev/null
49
49
 
50
50
    exec="$1"; shift
51
51
 
 
52
    args="--start --nicelevel $nice --quiet --oknodo"
52
53
    if [ $force = 1 ]; then
53
 
        /sbin/start-stop-daemon --start --nicelevel $nice --quiet --startas $exec --pidfile /dev/null --oknodo -- "$@"
 
54
        /sbin/start-stop-daemon $args --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@"
54
55
    elif [ $pidfile ]; then
55
 
        /sbin/start-stop-daemon --start --nicelevel $nice --quiet --exec $exec --oknodo --pidfile "$pidfile" -- "$@"
 
56
        /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@"
56
57
    else
57
 
        /sbin/start-stop-daemon --start --nicelevel $nice --quiet --exec $exec --oknodo -- "$@"
 
58
        /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@"
58
59
    fi
59
60
}
60
61
 
98
99
        fi
99
100
        return 0
100
101
    fi
 
102
    if [ "$specified" ]; then
 
103
        return 3 # program does not appear to be running after trying PID file
 
104
    fi
101
105
    return 4 # program or service is unknown
102
106
}
103
107