Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 1048965

Browse files
committed
deprecate the flag --nondaemon
The new bahavior is the same as the --nondaemon is always set. If the user want to launch hyperd as system daemon, the user should use the system daemon tools such as systemd. Signed-off-by: Lai Jiangshan <[email protected]>
1 parent b417cc0 commit 1048965

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

Diff for: hack/test-cmd.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ function start_hyperd()
4848
sudo "${HYPER_OUTPUT_HOSTBIN}/hyperd" \
4949
--host="tcp://127.0.0.1:${API_PORT}" \
5050
--v=3 \
51-
--config="${config}" \
52-
--nondaemon 1>&2 &
51+
--config="${config}" 1>&2 &
5352
HYPERD_PID=$!
5453

5554
if [ "$sdriver" == "devicemapper" ]; then

Diff for: hyperd.go

+3-18
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222
"github.com/hyperhq/runv/hypervisor"
2323

2424
"github.com/docker/docker/pkg/parsers/kernel"
25-
runvutils "github.com/hyperhq/runv/lib/utils"
26-
"github.com/kardianos/osext"
2725
)
2826

2927
type Options struct {
@@ -50,7 +48,7 @@ func main() {
5048
return
5149
}
5250

53-
fnd := flag.Bool("nondaemon", false, "Not daemonize")
51+
fnd := flag.Bool("nondaemon", false, "[deprecated flag]") // TODO: remove it when 0.8 is released
5452
flDisableIptables := flag.Bool("noniptables", false, "Don't enable iptables rules")
5553
flConfig := flag.String("config", "", "Config file for hyperd")
5654
flHost := flag.String("host", "", "Host for hyperd")
@@ -67,20 +65,8 @@ func main() {
6765
return
6866
}
6967

70-
if !*fnd {
71-
path, err := osext.Executable()
72-
if err != nil {
73-
fmt.Printf("cannot find self executable path for %s: %v\n", os.Args[0], err)
74-
os.Exit(-1)
75-
}
76-
77-
_, err = runvutils.ExecInDaemon(path, append([]string{os.Args[0], "--nondaemon"}, os.Args[1:]...))
78-
if err != nil {
79-
fmt.Println("failed to daemonize hyperd")
80-
os.Exit(-1)
81-
}
82-
83-
return
68+
if *fnd {
69+
fmt.Printf("flag --nondaemon is deprecated\n")
8470
}
8571

8672
var opt = &Options{
@@ -99,7 +85,6 @@ func printHelp() {
9985
%s [OPTIONS]
10086
10187
Application Options:
102-
--nondaemon Not daemonize
10388
--config="" Configuration for %s
10489
--v=0 Log level for V logs
10590
--log_dir Log directory

Diff for: mac_installer/dist/opt/hyper/static/config/sh.hyper.hyper.plist

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<string>--config=/opt/hyper/etc/hyper/config</string>
1111
<string>--log_dir=/var/log/hyper/</string>
1212
<string>-v=1</string>
13-
<string>--nondaemon</string>
1413
</array>
1514
<key>EnvironmentVariables</key>
1615
<dict>

Diff for: package/dist/lib/systemd/system/hyperd.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ After=network.target
55
Requires=
66

77
[Service]
8-
ExecStart=/usr/bin/hyperd --nondaemon --log_dir=/var/log/hyper
8+
ExecStart=/usr/bin/hyperd --log_dir=/var/log/hyper
99
MountFlags=shared
1010
LimitNOFILE=1048576
1111
LimitNPROC=1048576

0 commit comments

Comments
 (0)