~ubuntu-branches/ubuntu/raring/libvirt/raring

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# libvirtd upstart job
#
# XXX wait for rc to get all dependent initscripts started
# from sysv libvirtd initscript: Required-Start: $network messagebus
start on stopped rc RUNLEVEL=[345]
stop on runlevel [!345]

respawn

script
    LIBVIRTD_CONFIG=
    LIBVIRTD_ARGS=
    KRB5_KTNAME=/etc/libvirt/krb5.tab

    if [ -f /etc/sysconfig/libvirtd ]; then
        . /etc/sysconfig/libvirtd
    fi

    export QEMU_AUDIO_DRV
    export SDL_AUDIODRIVER
    export KRB5_KTNAME

    LIBVIRTD_CONFIG_ARGS=
    if [ -n "$LIBVIRTD_CONFIG" ]; then
        LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
    fi

    # DAEMON_COREFILE_LIMIT from /etc/sysconfig/libvirtd is not handled
    # automatically
    if [ -n "$DAEMON_COREFILE_LIMIT" ]; then
        ulimit -c "$DAEMON_COREFILE_LIMIT"
    fi

    # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
    # automatically
    if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
        ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
    fi
    mkdir -p /var/cache/libvirt
    rm -rf /var/cache/libvirt/*

    exec /usr/sbin/libvirtd $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
end script

post-stop script
    rm -rf /var/cache/libvirt/*
end script