Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate init sctipt to openrc, fix restarting problem #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions debian/mce.init
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@ description="This init script starts the mode control software used on the Maemo
name="Mode Control Entity."

depend() {
need dsme dbus dbus-user
need dbus dbus-user
after dsme
}

start_pre() {
ebegin "Starting mce"
RUNDIR=/var/run/mce
test -d $RUNDIR || (rm -f $RUNDIR; mkdir $RUNDIR)
/usr/sbin/waitdbus system
. /tmp/session_bus_address.user
/usr/sbin/waitdbus session
ebegin "Starting mce"
RUNDIR=/var/run/mce
test -d $RUNDIR || (rm -f $RUNDIR; mkdir $RUNDIR)
/usr/sbin/waitdbus system
. /tmp/session_bus_address.user
/usr/sbin/waitdbus session
}

start() {
/usr/sbin/dsmetool -n -1 -t "/sbin/mce --force-syslog"
start-stop-daemon --start --oknodo --background --exec /sbin/mce --make-pidfile --pidfile /var/run/mce.pid --retry 5 -- --force-syslog
eend $?
}

stop() {
eend "Stopping mce"
/usr/sbin/dsmetool -k "/sbin/mce --force-syslog"
eend "Stopping mce"
start-stop-daemon --stop --oknodo --pidfile /var/run/mce.pid --retry=TERM/30/KILL/5
eend $?
}