Project

General

Profile

Actions

Feature #6034

closed

[Deployment] Add sysvinit script to the keepproxy package

Added by Nico César almost 9 years ago. Updated almost 5 years ago.

Status:
Rejected
Priority:
Normal
Assigned To:
Category:
Deployment
Target version:
-
Story points:
1.0

Description

Functional requirements:

  • The script should always be installed somewhere under /usr/share/doc/keepproxy.
  • On every distro we currently support except Debian 8, install the init script in /etc/init.d, and set it up to run with the usual runlevels.
  • Users should not need to edit this file to make configuration changes. Instead they should make changes to a file in /etc/default (on Debian) or /etc/sysconfig (on Red Hat) which are respected by the init script.

Subtasks 1 (0 open1 closed)

Task #7349: Review 6034-keepproxy-initscript in arvados and arvados-devResolvedNico César10/14/2015Actions

Related issues

Related to Arvados - Idea #6884: [Deployment] Plan addition of init scripts to Arvados daemon packagesResolved08/05/2015Actions
Related to Arvados - Feature #7331: [Deployment] Add systemd unit definition to the keepproxy packageResolved09/14/2015Actions
Actions #1

Updated by Nico César almost 9 years ago

  • Subject changed from Add initscripts (sysv, runit, upstart) to keepproxy to Add initscripts (sysv, runit, upstart) to keepproxy
  • Story points set to 2.0
Actions #2

Updated by Nico César almost 9 years ago

  • Assigned To set to Nico César

So currently this kind of works:

pleaserun  --install --install-prefix /tmp/tmp.9FXtcyfpZk -p sysv -v lsb-3.1 /usr/bin/keepproxy

fpm --maintainer="Ward Vandewege <ward@curoverse.com>" \
  -s dir -t deb -x usr/local/lib/python2.7/dist-packages/tests \
  -n keepproxy --vendor "Curoverse, Inc." -v 0.1.20150511211101.dd5deb9 \
  --url=https://arvados.org --license="GNU Affero General Public License, version 3.0" \
  --description="Keepproxy makes a Keep cluster accessible to clients that are not on the LAN"\
  --deb-init=/tmp/tmp.9FXtcyfpZk/etc/init.d/keepproxy \
  --deb-default=/tmp/tmp.9FXtcyfpZk/etc/default/keepproxy \
  /tmp/tmp.9FXtcyfpZk/bin/keepproxy=/usr/bin/keepproxy

but we need to customize /etc/init.d/keepproxy to pass env variables and other (future) things.

we agree that the pleaserun should be used as a scaffold to create the initscripts and then commit them to the git repository. we have to discuss directories where to place them.

Actions #3

Updated by Nico César almost 9 years ago

  • Subject changed from Add initscripts (sysv, runit, upstart) to keepproxy to [OPS] Add initscripts (sysv, runit, upstart) to keepproxy
Actions #4

Updated by Nico César almost 9 years ago

the code of keepproxy is here:

arvados/services/keepproxy
 +-- keepproxy.go
 +-- keepproxy_test.go

is it ok to drop the init file there too?

At some point we'll have an init file per service (or app)

Actions #5

Updated by Tom Clegg almost 9 years ago

Nico Cesar wrote:

is it ok to drop the init file there too?

afaik go tools ignore anything other than *.go

However, if you run "go build" in that dir, go creates an executable called ./keepproxy, overwriting any existing file. Even though "go build" isn't part our recipe ("go get" puts stuff in $GOPATH/bin instead), we have keepproxy in .gitignore there, and I think it would be bad form / confusing / dangerous to use the bare name keepproxy for anything else.

So if it can be keepproxy-run or keepproxy-run.sh or something like that, no problem.

Actions #6

Updated by Ward Vandewege almost 9 years ago

Tom Clegg wrote:

Nico Cesar wrote:

is it ok to drop the init file there too?

afaik go tools ignore anything other than *.go

However, if you run "go build" in that dir, go creates an executable called ./keepproxy, overwriting any existing file. Even though "go build" isn't part our recipe ("go get" puts stuff in $GOPATH/bin instead), we have keepproxy in .gitignore there, and I think it would be bad form / confusing / dangerous to use the bare name keepproxy for anything else.

So if it can be keepproxy-run or keepproxy-run.sh or something like that, no problem.

Since we want to support numerous startup script schemes, can we namespace this in a directory?

Actions #7

Updated by Tom Clegg almost 9 years ago

Yes, Go doesn't mind if you have subdirs, so that would also work -- like services/keepproxy/pkg-extras/ cf. IRC

Actions #8

Updated by Brett Smith almost 9 years ago

  • Target version changed from 2015-05-20 sprint to Arvados Future Sprints
Actions #9

Updated by Tom Clegg over 8 years ago

  • Subject changed from [OPS] Add initscripts (sysv, runit, upstart) to keepproxy to [OPS] Add initscripts (sysv, runit, upstart) and a debconf template to keepproxy
Actions #10

Updated by Brett Smith over 8 years ago

  • Subject changed from [OPS] Add initscripts (sysv, runit, upstart) and a debconf template to keepproxy to [OPS] Add init scripts to the keepproxy package

I'm reverting Tom's change, in the spirit of having one issue be about one thing. I'll file a separate story about debconf.

See https://arvados.org/issues/6884#note-6 for discussion about what might be included in a first version.

Actions #11

Updated by Brett Smith over 8 years ago

  • Project changed from 40 to Arvados
  • Subject changed from [OPS] Add init scripts to the keepproxy package to [Deployment] Add init scripts to the keepproxy package
  • Category set to Deployment
Actions #12

Updated by Brett Smith over 8 years ago

  • Subject changed from [Deployment] Add init scripts to the keepproxy package to [Deployment] Add sysvinit script to the keepproxy package
  • Description updated (diff)
Actions #13

Updated by Brett Smith over 8 years ago

  • Description updated (diff)
Actions #14

Updated by Brett Smith over 8 years ago

  • Description updated (diff)
Actions #15

Updated by Nico César over 8 years ago

  • Target version changed from Arvados Future Sprints to 2015-09-30 sprint
Actions #16

Updated by Brett Smith over 8 years ago

  • Target version changed from 2015-09-30 sprint to 2015-10-14 sprint
  • Story points changed from 2.0 to 1.0
Actions #17

Updated by Nico César over 8 years ago

tried it out the debian7 version in keepproxy.tb05z and works

Actions #18

Updated by Ward Vandewege over 8 years ago

  • Status changed from New to In Progress
Actions #19

Updated by Ward Vandewege over 8 years ago

Reviewing 6034-keepproxy-initscript:

1. Error messages should be specific to the platform. I'm on debian7:

# /etc/init.d/keepproxy start
ARVADOS_API_HOST and ARVADOS_API_TOKEN must be set! check /etc/default/keepproxy or /etc/sysconfig/keepproxy

I shouldn't be told about /etc/sysconfig/keepproxy, which is a redhat directory.

2. When keepproxy fails to start, the init script pretends that all is well. That's because the process is backgrounded, and the exit code can not be checked for that reason. Please add a check that the pid reported in $! is actually still running; if not, let the user know that keepproxy failed to start.

3. I'm not wild about the way logging is done in the init script, but until we add some better logging options to keepproxy itself it'll have to do.

Actions #20

Updated by Ward Vandewege over 8 years ago

  • Target version changed from 2015-10-14 sprint to Arvados Future Sprints
Actions #21

Updated by Brett Smith over 8 years ago

  • Target version changed from Arvados Future Sprints to Kanban
Actions #22

Updated by Tom Morris about 7 years ago

  • Status changed from In Progress to Rejected
Actions #23

Updated by Tom Morris about 7 years ago

  • Target version deleted (Kanban)
Actions

Also available in: Atom PDF