Feature #6034
closed[Deployment] Add sysvinit script to the keepproxy package
Added by Nico César over 9 years ago. Updated over 5 years ago.
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.
Related issues
Updated by Nico César over 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
Updated by Nico César over 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.
Updated by Nico César over 9 years ago
- Subject changed from Add initscripts (sysv, runit, upstart) to keepproxy to [OPS] Add initscripts (sysv, runit, upstart) to keepproxy
Updated by Nico César over 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)
Updated by Tom Clegg over 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.
Updated by Ward Vandewege over 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?
Updated by Tom Clegg over 9 years ago
Yes, Go doesn't mind if you have subdirs, so that would also work -- like services/keepproxy/pkg-extras/ cf. IRC
Updated by Brett Smith over 9 years ago
- Target version changed from 2015-05-20 sprint to Arvados Future Sprints
Updated by Tom Clegg about 9 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
Updated by Brett Smith about 9 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.
Updated by Brett Smith about 9 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
Updated by Brett Smith almost 9 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)
Updated by Nico César almost 9 years ago
- Target version changed from Arvados Future Sprints to 2015-09-30 sprint
Updated by Brett Smith almost 9 years ago
- Target version changed from 2015-09-30 sprint to 2015-10-14 sprint
- Story points changed from 2.0 to 1.0
Updated by Nico César almost 9 years ago
tried it out the debian7 version in keepproxy.tb05z and works
Updated by Ward Vandewege almost 9 years ago
- Status changed from New to In Progress
Updated by Ward Vandewege almost 9 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.
Updated by Ward Vandewege almost 9 years ago
- Target version changed from 2015-10-14 sprint to Arvados Future Sprints
Updated by Brett Smith almost 9 years ago
- Target version changed from Arvados Future Sprints to Kanban
Updated by Tom Morris over 7 years ago
- Status changed from In Progress to Rejected