libvirt/daemon/libvirtd.upstart
Michal Privoznik d7320e799f daemon: Allow overriding NOFILES ulimit for the daemon as well
One of my latest patches (d8db0f9690) created support for setting
the limit for the maximum of opened files by qemu user. However,
since libvirtd keeps one FD opened per domain (well, for qemu at least)
it will likely hit this limit on huge scenarios.
2012-02-01 16:04:30 +01:00

48 lines
1.2 KiB
Plaintext

# 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