Skip to content

Commit

Permalink
make start-stop-daemon quite, move symlink check to start_pre(), add …
Browse files Browse the repository at this point in the history
…dependency on net to depend()
  • Loading branch information
SpiderX committed Jul 2, 2017
1 parent 6d0fb57 commit 2c68c4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qemu.initd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ command_args="-mon chardev=qmp,mode=control \
-numa node,nodeid=${NUMA},memdev=${NUMAMEM} \
-k ${LANGUAGE:-en-us} ${OPTS}"
name="${command##*/} for ${ID} (${NAME})"
start_stop_daemon_args="--verbose"
start_stop_daemon_args="-q"
description="Start the system"
extra_commands="reboot"
description_reboot="Reboot the system"
Expand All @@ -44,6 +44,8 @@ description_suspend="Suspend running system"
description_status="Show system status"

start_pre() {
if [ "$SVCNAME" = 'qemu' ] || [ "$SVCNAME" = 'kvm' ] ; then eerror "Create a symlink for the VM you want to run"; return 1; fi

if yesno ${KVM}; then command_args="${command_args} -enable-kvm"; fi
if yesno ${DAEMON}; then command_args="${command_args} -daemonize"; fi
if yesno ${NODEFAULTS}; then command_args="${command_args} -nodefaults"; fi
Expand All @@ -60,7 +62,7 @@ start_pre() {
}

depend() {
if [ "$SVCNAME" = 'qemu' ] || [ "$SVCNAME" = 'kvm' ] ; then eerror "Create a symlink for the VM you want to run"; return 0; fi
need net
}

console() {
Expand Down

0 comments on commit 2c68c4b

Please sign in to comment.