"--verbose",
"--deb-use-file-permissions",
"--rpm-use-file-permissions",
+ "/etc/systemd/system/multi-user.target.wants/arvados.service",
+ "/lib/systemd/system/arvados.service",
+ "/usr/bin/arvados-client",
+ "/usr/bin/arvados-server",
"/var/lib/arvados",
"/var/www/.gem",
"/var/www/.passenger",
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+[Unit]
+Description=Arvados server
+Documentation=https://doc.arvados.org/
+After=network.target
+AssertPathExists=/etc/arvados/config.yml
+
+# systemd>=230 (debian:9) obeys StartLimitIntervalSec in the [Unit] section
+StartLimitIntervalSec=0
+
+[Service]
+Type=notify
+EnvironmentFile=-/etc/arvados/environment
+ExecStart=/usr/bin/arvados-server boot
+# Set a reasonable default for the open file limit
+LimitNOFILE=65536
+Restart=always
+RestartSec=1
+
+# systemd<=219 (centos:7, debian:8, ubuntu:trusty) obeys StartLimitInterval in the [Service] section
+StartLimitInterval=0
+
+[Install]
+WantedBy=multi-user.target
"bufio"
"bytes"
"context"
+ _ "embed"
"errors"
"flag"
"fmt"
workbench2version = "5e020488f67b5bc919796e0dc8b0b9f3b3ff23b0"
)
+//go:embed arvados.service
+var arvadosServiceFile []byte
+
type installCommand struct {
ClusterType string
SourcePath string
}
}
+ // Symlink user-facing Go programs /usr/bin/x ->
+ // /var/lib/arvados/bin/x
+ for _, prog := range []string{"arvados-client", "arvados-server"} {
+ err = os.Remove("/usr/bin/" + prog)
+ if err != nil && !errors.Is(err, os.ErrNotExist) {
+ return 1
+ }
+ err = os.Symlink("/var/lib/arvados/bin/"+prog, "/usr/bin/"+prog)
+ if err != nil {
+ return 1
+ }
+ }
+
// Copy assets from source tree to /var/lib/arvados/share
cmd := exec.Command("install", "-v", "-t", "/var/lib/arvados/share", filepath.Join(inst.SourcePath, "sdk/python/tests/nginx.conf"))
cmd.Stdout = stdout
`, stdout, stderr); err != nil {
return 1
}
+
+ err = os.WriteFile("/lib/systemd/system/arvados.service", arvadosServiceFile, 0777)
+ if err != nil {
+ return 1
+ }
+ // This is equivalent to "systemd enable", but does
+ // not depend on the systemctl program being
+ // available.
+ symlink := "/etc/systemd/system/multi-user.target.wants/arvados.service"
+ err = os.Remove(symlink)
+ if err != nil && !errors.Is(err, os.ErrNotExist) {
+ return 1
+ }
+ err = os.Symlink("/lib/systemd/system/arvados.service", symlink)
+ if err != nil {
+ return 1
+ }
}
return 0