mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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.
This commit is contained in:
parent
7bceae0fa6
commit
d7320e799f
@ -60,6 +60,13 @@ start() {
|
||||
echo -n $"Starting $SERVICE daemon: "
|
||||
mkdir -p @localstatedir@/cache/libvirt
|
||||
rm -rf @localstatedir@/cache/libvirt/*
|
||||
|
||||
# LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
|
||||
# automatically
|
||||
if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
|
||||
ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
|
||||
fi
|
||||
|
||||
KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
|
||||
RETVAL=$?
|
||||
echo
|
||||
|
@ -15,6 +15,8 @@ Before=libvirt-guests.service
|
||||
EnvironmentFile=-/etc/sysconfig/libvirtd
|
||||
ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
# Override the maximum number of opened files
|
||||
#LimitNOFILE=2048
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -19,3 +19,6 @@
|
||||
#QEMU_AUDIO_DRV=sdl
|
||||
#
|
||||
#SDL_AUDIODRIVER=pulse
|
||||
|
||||
# Override the maximum number of opened files
|
||||
#LIBVIRTD_NOFILES_LIMIT=2048
|
||||
|
@ -31,6 +31,11 @@ script
|
||||
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/*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user