1f4053bbd9
if the SingletonLock file is available and valid. The problem is that when chrome crashes one of the destructors fail to remove the lockfile and then when you start chrome again, it will try to communicate with the old PID of the chromium main process, because the SingletonLock file will point to `hostname`-PID_of_old_chromium and since that process is not running anymore, startup will fail.
38 lines
1.0 KiB
Bash
38 lines
1.0 KiB
Bash
#!/bin/sh
|
|
# $OpenBSD: chrome,v 1.9 2012/05/17 08:52:59 robert Exp $
|
|
|
|
DATASIZE="716800"
|
|
OPENFILES="400"
|
|
|
|
xm_log() {
|
|
echo -n "$@\nDo you want to run Chromium anyway?\n\
|
|
(If you don't increase these limits, Chromium might fail to work properly.)" | \
|
|
${X11BASE}/bin/xmessage -file - -center -buttons yes:0,no:1 -default no
|
|
}
|
|
|
|
if [ $(ulimit -Sd) -lt ${DATASIZE} ]; then
|
|
ulimit -Sd ${DATASIZE} || \
|
|
xm_log "Cannot increase datasize-cur to at least ${DATASIZE}"
|
|
[ $? -eq 0 ] || exit
|
|
fi
|
|
|
|
if [ $(ulimit -Sn) -lt ${OPENFILES} ]; then
|
|
ulimit -Sn ${OPENFILES} || \
|
|
xm_log "Cannot increase openfiles-cur to at least ${OPENFILES}"
|
|
[ $? -eq 0 ] || exit
|
|
fi
|
|
|
|
#
|
|
# Temporary workaround for the case when chromium crashes and leaves
|
|
# the SingletonLock, which prevents chromium to start up.
|
|
#
|
|
if [ -h ${HOME}/.config/chromium/SingletonLock ]; then
|
|
_pid=`readlink ${HOME}/.config/chromium/SingletonLock | cut -d '-' -f 2`
|
|
kill -0 ${_pid} 2>/dev/null
|
|
if [ $? -gt 0 ]; then
|
|
rm ${HOME}/.config/chromium/SingletonLock
|
|
fi
|
|
fi
|
|
|
|
exec "${TRUEPREFIX}/chrome/chrome" "${@}"
|