View previous topic :: View next topic |
Author |
Message |
kriz Apprentice
Joined: 22 Jan 2003 Posts: 231
|
Posted: Fri Nov 02, 2012 5:45 pm Post subject: start-stop-daemon |
|
|
Hello,
For a couple of years i have the g15daemon running without any issues.
Since last week i get this error when the start-stop-daemon terminated the g15daemon:
Code: |
start-stop-daemon: fopen `/var/run/g15daemon.pid': No such file or directory
|
The original looking of the script:
Code: |
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/g15daemon/files/g15daemon-1.2.7-r2.initd,v 1.1 2007/12/19 17:38:30 chainsaw Exp $
# Init script for g15daemon
depend() {
after hotplug
after usb
after modules
}
start() {
ebegin "Starting g15daemon"
# Does the input device already exist?
if [ -e /proc/modules -a ! -e /dev/input/uinput ]; then
# We can load modules, but uinput device does not exist
einfo "Loading uinput module"
/sbin/modprobe uinput > /dev/null 2> /dev/null
fi
local SWITCHKEY=""
[ "${CLIENT_SWITCH_L1}" = "yes" ] && SWITCHKEY="--switch"
start-stop-daemon --start --background --pidfile /var/run/g15daemon.pid \
--exec /usr/sbin/g15daemon -- ${SWITCHKEY}
eend $? "Failed to start g15daemon."
}
stop() {
ebegin "Stopping g15daemon"
local KILLOPT="-k"
if [ $BACKLIGHT_OFF = "yes" ]; then
KILLOPT="-K"
fi
/usr/sbin/g15daemon ${KILLOPT} &>/dev/null
sleep 1
start-stop-daemon -R 5 --stop --quiet --pidfile /var/run/g15daemon.pid
eend $?
}
|
So, now if i delete the sleep 1 before the start-stop-daemon catch the g15daemon.pid all working as desired.
But why?
There is no function that delete the pid-file before the start-stop-daemon terminate the g15daemon.
cc _________________ There is nothing in the desert... and no man needs nothing. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Nov 02, 2012 7:01 pm Post subject: |
|
|
I would assume that g15daemon has changed behaviour:
It used to quit in the background.
It now quits in the foreground.
Where quitting involves deleting /var/run/g15daemon.pid
Previously, g15daemon and start-stop-daemon would have been in a race to delete /var/run/g15daemon.pid, if my assumption is correct. |
|
Back to top |
|
|
kriz Apprentice
Joined: 22 Jan 2003 Posts: 231
|
Posted: Fri Nov 02, 2012 8:27 pm Post subject: |
|
|
Ok ty for now.
I'll investigate this behavior and do some google around. _________________ There is nothing in the desert... and no man needs nothing. |
|
Back to top |
|
|
|