init scripts included in the apt-get install for tahoe-lafs on Debian/Ubuntu derivatives #961

Closed
opened 2010-02-20 05:44:57 +00:00 by stott · 37 comments
stott commented 2010-02-20 05:44:57 +00:00
Owner

/etc/init scripts should be included by default to start tahoe-lafs if there are configured nodes, introducrs or helpers, Tahoe should auto-start. Run level 3, after most other services are up and running.

/etc/init scripts should be included by default to start tahoe-lafs if there are configured nodes, introducrs or helpers, Tahoe should auto-start. Run level 3, after most other services are up and running.
tahoe-lafs added the
c/packaging
p/minor
t/enhancement
v/1.5.0
labels 2010-02-20 05:44:57 +00:00
tahoe-lafs added this to the eventually milestone 2010-02-20 05:44:57 +00:00
USSJoin commented 2010-02-21 01:49:19 +00:00
Author
Owner

So I just spent a few hours trying to write an upstart (the new ubuntu replacement for init.d) script for Tahoe. It appears not to be possible, because the Tahoe daemon forks in such a way that the initctl processes can't follow it (with either the "expect daemon" or "expect fork" stanzas).

However, there's an easy workaround I've found, that I'm now using:

ln -s /usr/local/bin/tahoe /etc/init.d/tahoe

This does require that the "root" user be able to run tahoe, which requires an

ln -s /path/to/your/.tahoe /root/.tahoe

But that's also required by any (theoretical) upstart script.

So I just spent a few hours trying to write an upstart (the new ubuntu replacement for init.d) script for Tahoe. It appears not to be possible, because the Tahoe daemon forks in such a way that the initctl processes can't follow it (with either the "expect daemon" or "expect fork" stanzas). However, there's an easy workaround I've found, that I'm now using: ln -s /usr/local/bin/tahoe /etc/init.d/tahoe This *does* require that the "root" user be able to run tahoe, which requires an ln -s /path/to/your/.tahoe /root/.tahoe But that's also required by any (theoretical) upstart script.

Replying to USSJoin:

However, there's an easy workaround I've found, that I'm now using:

ln -s /usr/local/bin/tahoe /etc/init.d/tahoe

This does require that the "root" user be able to run tahoe, which requires an

ln -s /path/to/your/.tahoe /root/.tahoe

But that's also required by any (theoretical) upstart script.

Note that this conflicts with #725 ("we should whine if we're running as root"). Apart from being a really bad idea because of excess privilege, running the gateway as root causes directories and files to be owned by root and not accessible to other users, which then hoses any attempt to run the gateway as another user. (The CLI should still work provided that tahoe create-node or tahoe create-client wasn't run as root.)

Replying to [USSJoin](/tahoe-lafs/trac/issues/961#issuecomment-376521): > However, there's an easy workaround I've found, that I'm now using: > > ln -s /usr/local/bin/tahoe /etc/init.d/tahoe > > This *does* require that the "root" user be able to run tahoe, which requires an > > ln -s /path/to/your/.tahoe /root/.tahoe > > But that's also required by any (theoretical) upstart script. Note that this conflicts with #725 ("we should whine if we're running as root"). Apart from being a really bad idea because of excess privilege, running the gateway as root causes directories and files to be owned by root and not accessible to other users, which then hoses any attempt to run the gateway as another user. (The CLI should still work provided that `tahoe create-node` or `tahoe create-client` wasn't run as root.)
daira modified the milestone from eventually to 1.7.0 2010-02-27 09:00:54 +00:00

Attachment tahoelafsd (3124 bytes) added

An init.d script created for Debian Lenny (from /etc/init.d/skel)

**Attachment** tahoelafsd (3124 bytes) added An init.d script created for Debian Lenny (from /etc/init.d/skel)
3.1 KiB

Attachment tahoelafsd.2 (300 bytes) added

this file goes in /etc/default/tahoelafsd

**Attachment** tahoelafsd.2 (300 bytes) added this file goes in /etc/default/tahoelafsd

A Debian user should do the following to securely run Tahoe:

addgroup --system tahoelafsd
adduser --disabled-login --system --home /var/lib/tahoelafs --shell /bin/bash --ingroup tahoelafsd tahoelafsd 
tahoe create client /var/lib/tahoelafs/

When using the init.d script that I have attached, Tahoe will run as the user tahoelafsd user and not as root.

The Tahoe packages should include this as part of the files provided in debian/

A Debian user should do the following to securely run Tahoe: ``` addgroup --system tahoelafsd adduser --disabled-login --system --home /var/lib/tahoelafs --shell /bin/bash --ingroup tahoelafsd tahoelafsd tahoe create client /var/lib/tahoelafs/ ``` When using the init.d script that I have attached, Tahoe will run as the user tahoelafsd user and not as root. The Tahoe packages should include this as part of the files provided in debian/

It's probably a good idea to keep the entire tahoelafs home directory hidden from the rest of the system:

chmod 750 /var/lib/tahoelafs/

It's important to note that you'll want to edit the /var/lib/tahoelafs/tahoe.cfg file after the creation of the client config or the init.d script will not work.

By default, I think that the init.d script should simply not start tahoe without a configuration... I'll add that and replace the DEFAULTS file....

It's probably a good idea to keep the entire tahoelafs home directory hidden from the rest of the system: ``` chmod 750 /var/lib/tahoelafs/ ``` It's important to note that you'll want to edit the /var/lib/tahoelafs/tahoe.cfg file after the creation of the client config or the init.d script will not work. By default, I think that the init.d script should simply not start tahoe without a configuration... I'll add that and replace the DEFAULTS file....

Attachment tahoelafsd.3 (581 bytes) added

New defaults file for debian

**Attachment** tahoelafsd.3 (581 bytes) added New defaults file for debian

Attachment tahoelafsd.4 (591 bytes) added

tahoe defaults file

**Attachment** tahoelafsd.4 (591 bytes) added tahoe defaults file

Attachment tahoelafsd.5 (3272 bytes) added

finial version of init.d script that uses defaults properly

**Attachment** tahoelafsd.5 (3272 bytes) added finial version of init.d script that uses defaults properly

It's likely that Tahoe (post-configuration) should start at boot:

# update-rc.d -f tahoelafsd defaults
 Adding system startup for /etc/init.d/tahoelafsd ...
   /etc/rc0.d/K20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc1.d/K20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc6.d/K20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc2.d/S20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc3.d/S20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc4.d/S20tahoelafsd -> ../init.d/tahoelafsd
   /etc/rc5.d/S20tahoelafsd -> ../init.d/tahoelafsd
It's likely that Tahoe (post-configuration) should start at boot: ``` # update-rc.d -f tahoelafsd defaults Adding system startup for /etc/init.d/tahoelafsd ... /etc/rc0.d/K20tahoelafsd -> ../init.d/tahoelafsd /etc/rc1.d/K20tahoelafsd -> ../init.d/tahoelafsd /etc/rc6.d/K20tahoelafsd -> ../init.d/tahoelafsd /etc/rc2.d/S20tahoelafsd -> ../init.d/tahoelafsd /etc/rc3.d/S20tahoelafsd -> ../init.d/tahoelafsd /etc/rc4.d/S20tahoelafsd -> ../init.d/tahoelafsd /etc/rc5.d/S20tahoelafsd -> ../init.d/tahoelafsd ```

Attachment debian-init-script-patch-final (9700 bytes) added

the lenny files required to install, remove, and purge a .deb

**Attachment** debian-init-script-patch-final (9700 bytes) added the lenny files required to install, remove, and purge a .deb

With the above patch, I've installed, uninstalled, reinstalled, purged, and then installed again. I have configured my daemon to run by editing /etc/defaults/allmydata-tahoe and having a configured /var/lib/tahoelafsd directory...

I've also configured it to run at boot like so:

 update-rc.d -f allmydata-tahoe defaults
 Adding system startup for /etc/init.d/allmydata-tahoe ...
   /etc/rc0.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc1.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc6.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc2.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc3.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc4.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe
   /etc/rc5.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe
With the above patch, I've installed, uninstalled, reinstalled, purged, and then installed again. I have configured my daemon to run by editing /etc/defaults/allmydata-tahoe and having a configured /var/lib/tahoelafsd directory... I've also configured it to run at boot like so: ``` update-rc.d -f allmydata-tahoe defaults Adding system startup for /etc/init.d/allmydata-tahoe ... /etc/rc0.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc1.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc6.d/K20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc2.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc3.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc4.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe /etc/rc5.d/S20allmydata-tahoe -> ../init.d/allmydata-tahoe ```

Needs documentation. Also, is dpkg --remove supposed to remove the user/group?

The Debian FAQ says:

  • Remove a package (but not its configuration files): dpkg --remove foo
  • Remove a package (including its configuration files): dpkg --purge foo

(also see here).

Maybe --purge should remove the user/group and --remove should not (but I'm not an expert on Debian package management).

Needs documentation. Also, is `dpkg --remove` supposed to remove the user/group? The [Debian FAQ](http://www.debian.org/doc/FAQ/ch-pkgtools.en.html) says: * Remove a package (but not its configuration files): `dpkg --remove foo` * Remove a package (including its configuration files): `dpkg --purge foo` (also see [here](http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html#s-pkgstatus)). Maybe `--purge` should remove the user/group and `--remove` should not (but I'm not an expert on Debian package management).

Replying to davidsarah:

Also, is dpkg --remove supposed to remove the user/group?

Oh, you changed that in a later patch. Never mind, that looks right now (remove only the user on purge).

Replying to [davidsarah](/tahoe-lafs/trac/issues/961#issuecomment-376528): > Also, is `dpkg --remove` supposed to remove the user/group? Oh, you changed that in a later patch. Never mind, that looks right now (remove only the user on purge).
francois commented 2010-03-04 19:57:07 +00:00
Author
Owner

Attachment fix-debian-building-instructions.dpatch (2287 bytes) added

This patch fix a few missing commands in ioerror's modifications to docs/debian.txt

**Attachment** fix-debian-building-instructions.dpatch (2287 bytes) added This patch fix a few missing commands in ioerror's modifications to docs/debian.txt

Attachment debian-docs-patch-final.txt (4549 bytes) added

Only two packages aren't .debs now

**Attachment** debian-docs-patch-final.txt (4549 bytes) added Only two packages aren't .debs now

What other documentation should I write up? Perhaps a man page? Or just continuing to flesh out the debian.txt?

I've attached my current debian.txt - it's how I build Tahoe on my current production system that is on the volunteer grid. I changed a few steps to match the documentation patch from francois.

What other documentation should I write up? Perhaps a man page? Or just continuing to flesh out the debian.txt? I've attached my current debian.txt - it's how I build Tahoe on my current production system that is on the volunteer grid. I changed a few steps to match the documentation patch from francois.

There's one issue that is currently outstanding in this package but seemingly unrelated to Debian. It appears that setuptools has a multiple input warning:

# /etc/init.d/allmydata-tahoe start
/usr/lib/python2.5/site-packages/zope/__init__.py:19: UserWarning: Module allmydata was already imported from /usr/lib/python2.5/site-packages/allmydata/__init__.py, but /usr/lib/python2.5/site-packages is being added to sys.path
  import pkg_resources
STARTING /var/lib/tahoelafsd
client node probably started
There's one issue that is currently outstanding in this package but seemingly unrelated to Debian. It appears that setuptools has a multiple input warning: ``` # /etc/init.d/allmydata-tahoe start /usr/lib/python2.5/site-packages/zope/__init__.py:19: UserWarning: Module allmydata was already imported from /usr/lib/python2.5/site-packages/allmydata/__init__.py, but /usr/lib/python2.5/site-packages is being added to sys.path import pkg_resources STARTING /var/lib/tahoelafsd client node probably started ```
diff -u allmydata-tahoe /tmp/allmydata-tahoe.init 
--- allmydata-tahoe.init     2010-03-04 00:48:45.000000000 -0800
+++ /tmp/allmydata-tahoe.init    2010-03-05 19:31:53.000000000 -0800
@@ -21,7 +21,6 @@
 DAEMONHOME="/var/lib/tahoelafsd/"
 DAEMON=/usr/bin/$NAME
 DAEMON_ARGS=" start $DAEMONHOME"
-PIDFILE=/var/lib/tahoelafsd/twisted.pid
 USERNAME=tahoelafsd
 SCRIPTNAME=/etc/init.d/$NAME
``` diff -u allmydata-tahoe /tmp/allmydata-tahoe.init --- allmydata-tahoe.init 2010-03-04 00:48:45.000000000 -0800 +++ /tmp/allmydata-tahoe.init 2010-03-05 19:31:53.000000000 -0800 @@ -21,7 +21,6 @@ DAEMONHOME="/var/lib/tahoelafsd/" DAEMON=/usr/bin/$NAME DAEMON_ARGS=" start $DAEMONHOME" -PIDFILE=/var/lib/tahoelafsd/twisted.pid USERNAME=tahoelafsd SCRIPTNAME=/etc/init.d/$NAME ```

Let's see... this ticket was "assigned" to warner (by me) but he never "accepted" it, so he hasn't indicated that he actually intends to review it soon. Could someone else review it?

Let's see... this ticket was "assigned" to warner (by me) but he never "accepted" it, so he hasn't indicated that he actually intends to review it soon. Could someone else review it?

FYI, "tahoe start" is a simple frontend to "twistd", the Twisted daemon-launching tool. Eventually we'll fix it so that any extra arguments you pass to "tahoe start" will be copied to "twistd", which will let you get a bit more control over how the daemon is started.

In the meantime, you can run twistd directly. "tahoe start BASEDIR" is equivalent to something like "cd BASEDIR && twistd -y *.tac --logfile logs/twistd.log". If you add --nodaemon to the twistd arguments, it won't daemonize. If you want to launch tahoe from an init.d script using start-stop-daemon, that's probably what you want to use. You might also want to use the --pidfile argument to control where the pidfile goes.

FYI, "tahoe start" is a simple frontend to "twistd", the Twisted daemon-launching tool. Eventually we'll fix it so that any extra arguments you pass to "tahoe start" will be copied to "twistd", which will let you get a bit more control over how the daemon is started. In the meantime, you can run twistd directly. "`tahoe start BASEDIR`" is equivalent to something like "`cd BASEDIR && twistd -y *.tac --logfile logs/twistd.log`". If you add `--nodaemon` to the twistd arguments, it won't daemonize. If you want to launch tahoe from an init.d script using start-stop-daemon, that's probably what you want to use. You might also want to use the --pidfile argument to control where the pidfile goes.

What's the status of this ticket? It was assigned to Brian but he hasn't accepted it, and it is marked as review-needed. I don't understand if Brian's comment:376534 was intended as a code review requesting further changes or if it was just helpful commentary. I'm unassigning this from Brian and issuing a call for a reviewer. wiki/PatchReviewProcess

What's the status of this ticket? It was assigned to Brian but he hasn't accepted it, and it is marked as `review-needed`. I don't understand if Brian's [comment:376534](/tahoe-lafs/trac/issues/961#issuecomment-376534) was intended as a code review requesting further changes or if it was just helpful commentary. I'm unassigning this from Brian and issuing a call for a reviewer. [wiki/PatchReviewProcess](wiki/PatchReviewProcess)

Brian: I wonder if people are put off from taking another step on this ticket because they aren't sure what you meant in comment:376534. Just in case, would you please state whether the code here is good enough or whether in your opinion changes are needed? If the former, please remove review-needed from the keywords and add reviewed to the keywords. If the latter, please remove review-needed from the keywords. Thanks!

Brian: I wonder if people are put off from taking another step on this ticket because they aren't sure what you meant in [comment:376534](/tahoe-lafs/trac/issues/961#issuecomment-376534). Just in case, would you please state whether the code here is good enough or whether in your opinion changes are needed? If the former, please remove `review-needed` from the keywords and add `reviewed` to the keywords. If the latter, please remove `review-needed` from the keywords. Thanks!
zooko modified the milestone from 1.7.0 to soon 2010-06-17 04:39:31 +00:00
taral commented 2010-06-17 22:37:16 +00:00
Author
Owner

python-foolscap is packaged in debian sid.

Instead of packaging argparse and zbase32, you could just include them in the allmydata package directly. They are pretty small.

+1 to running twistd directly instead of using tahoe start. Or add a --nodaemon flag to tahoe start that causes it to exec twistd instead of forking?

Why do you have automatically generated sections in your postinst? Oh, I see. darcs unrecord is your friend.

Why not remove the group you created?

python-foolscap is packaged in debian sid. Instead of packaging argparse and zbase32, you could just include them in the allmydata package directly. They are pretty small. +1 to running twistd directly instead of using tahoe start. Or add a --nodaemon flag to tahoe start that causes it to exec twistd instead of forking? Why do you have automatically generated sections in your postinst? Oh, I see. darcs unrecord is your friend. Why not remove the group you created?

Zooko: comment:376534 was intended as helpful commentary. Folks who want to write init scripts but who are put off by "tahoe start"'s automatic daemonizing. Such folks could use the information in comment:376534 to write a better init script.

I haven't touched tahoe+debian packaging in a long time.. I'm not currently familiar with how we're doing it (if at all). The last I remember was planning a new out-of-tree scheme using git-buildpackage and a collection of schroot jails (of various ubuntu/debian) versions on an EC2 host. My thought was to copy the debian.diff files from that effort back into the tahoe source tree. I vaguely remember thinking that I wanted to keep the in-tree stuff simple, and leave things like init.d scripts "to the professionals" (i.e. the actual ubuntu/debian packages that ship in Lenny, etc), and perhaps as a result not putting energy into landing tese patches.

So I cannot currently sign off on the patches: I don't have the time to page that stuff back into my brain and do a proper review. Maybe next week.

Zooko: [comment:376534](/tahoe-lafs/trac/issues/961#issuecomment-376534) was intended as helpful commentary. Folks who want to write init scripts but who are put off by "tahoe start"'s automatic daemonizing. Such folks could use the information in [comment:376534](/tahoe-lafs/trac/issues/961#issuecomment-376534) to write a better init script. I haven't touched tahoe+debian packaging in a long time.. I'm not currently familiar with how we're doing it (if at all). The last I remember was planning a new out-of-tree scheme using git-buildpackage and a collection of schroot jails (of various ubuntu/debian) versions on an EC2 host. My thought was to copy the debian.diff files from that effort back into the tahoe source tree. I vaguely remember thinking that I wanted to keep the in-tree stuff simple, and leave things like init.d scripts "to the professionals" (i.e. the actual ubuntu/debian packages that ship in Lenny, etc), and perhaps as a result not putting energy into landing tese patches. So I cannot currently sign off on the patches: I don't have the time to page that stuff back into my brain and do a proper review. Maybe next week.
zooko changed title from There are no init scripts included in the Ubuntu apt-get install for tahoe-lafs to init scripts included in the Ubuntu apt-get install for tahoe-lafs 2010-07-14 06:19:55 +00:00

I had reviewed a previous version of these patches, and the changes since then look good. I think that any remaining issues (e.g. comment:376531) are minor and new tickets should be opened for them.

I suggest committing these patches for 1.7.1, or failing that 1.8beta. They won't cause regressions; the worst that can happen is that the scripts don't do precisely what users want.

I had reviewed a previous version of these patches, and the changes since then look good. I think that any remaining issues (e.g. [comment:376531](/tahoe-lafs/trac/issues/961#issuecomment-376531)) are minor and new tickets should be opened for them. I suggest committing these patches for 1.7.1, or failing that 1.8beta. They won't cause regressions; the worst that can happen is that the scripts don't do precisely what users want.
zooko modified the milestone from soon to 1.7.1 2010-07-18 04:35:33 +00:00

applied in changeset:ca660a5fc6cb8d55, changeset:babbdf949437116b. Thanks, Jacob and David-Sarah!

applied in changeset:ca660a5fc6cb8d55, changeset:babbdf949437116b. Thanks, Jacob and David-Sarah!
zooko added the
r/fixed
label 2010-07-18 05:52:50 +00:00
zooko closed this issue 2010-07-18 05:52:50 +00:00

I was talking with intrigeri about including Tahoe-LAFS in Tails (https://tails.boum.org/), and he pointed out this Debian bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003 . That bug report by Thomas Pierson contact@thomaspierson.fr says that he can't find the actual init script anywhere. Sure enough, reviewing this ticket it appears to me that we accidentally omitted the actual init script (final version attached to this ticket by ioerror: attachment:debian-init-script-patch-final).

Daira: did you review attachment:debian-init-script-patch-final? You wrote review notes in comment:376541.

ioerror: why did you post the diff in comment:376532? Why remove the PID file variable setting?

I was talking with intrigeri about including Tahoe-LAFS in Tails (<https://tails.boum.org/>), and he pointed out this Debian bug report: <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003> . That bug report by Thomas Pierson <contact@thomaspierson.fr> says that he can't find the actual init script anywhere. Sure enough, reviewing this ticket it appears to me that we accidentally omitted the actual init script (final version attached to this ticket by ioerror: attachment:debian-init-script-patch-final). Daira: did you review attachment:debian-init-script-patch-final? You wrote review notes in [comment:376541](/tahoe-lafs/trac/issues/961#issuecomment-376541). ioerror: why did you post the diff in [comment:376532](/tahoe-lafs/trac/issues/961#issuecomment-376532)? Why remove the PID file variable setting?
zooko removed the
r/fixed
label 2013-07-06 14:43:22 +00:00
zooko reopened this issue 2013-07-06 14:43:22 +00:00
Author
Owner

Is there a documented general strategy for how to place OS-specific helper files? It seems that these could be provided for a dozen systems, at least and thus there should be some subdirectory structure to avoid this getting cluttered.

There's also the issue of whether things are included with the sources or are part of packaging. Probably most things belong in the sources so they can be used/tested independently of packages. But user creation feels like it should be a packaging thing.

Is there a documented general strategy for how to place OS-specific helper files? It seems that these could be provided for a dozen systems, at least and thus there should be some subdirectory structure to avoid this getting cluttered. There's also the issue of whether things are included with the sources or are part of packaging. Probably most things belong in the sources so they can be used/tested independently of packages. But user creation feels like it should be a packaging thing.

Replying to zooko:

Daira: did you review attachment:debian-init-script-patch-final?

Yes (and I just rereviewed it). I'm not an expert on Debian packaging, but it looks fine to me, modulo this:

ioerror: why did you post the diff in comment:376532? Why remove the PID file variable setting?

I'm not ioerror, but the PIDFILE variable appears to be unused (and the pid file is called twistd.pid anyway, not twisted.pid).

Replying to [zooko](/tahoe-lafs/trac/issues/961#issuecomment-376546): > Daira: did you review attachment:debian-init-script-patch-final? Yes (and I just rereviewed it). I'm not an expert on Debian packaging, but it looks fine to me, modulo this: > ioerror: why did you post the diff in [comment:376532](/tahoe-lafs/trac/issues/961#issuecomment-376532)? Why remove the PID file variable setting? I'm not ioerror, but the `PIDFILE` variable appears to be unused (and the pid file is called `twistd.pid` anyway, not `twisted.pid`).
daira added
p/normal
and removed
p/minor
labels 2013-07-06 19:21:31 +00:00
daira modified the milestone from 1.7.1 to 1.11.0 2013-07-06 19:21:31 +00:00

Replying to [daira]comment:27:

Replying to zooko:

Daira: did you review attachment:debian-init-script-patch-final?

Yes (and I just rereviewed it). I'm not an expert on Debian packaging, but it looks fine to me, modulo this: [...]

and misc/lenny no longer being an appropriate directory to put it in.

Replying to [daira]comment:27: > Replying to [zooko](/tahoe-lafs/trac/issues/961#issuecomment-376546): > > Daira: did you review attachment:debian-init-script-patch-final? > > Yes (and I just rereviewed it). I'm not an expert on Debian packaging, but it looks fine to me, modulo this: [...] and `misc/lenny` no longer being an appropriate directory to put it in.

Per ticket #1454, we decided to remove the debian package files from the upstream source repository since those files were now being maintained by debian. This turns out to be partially mistaken, as this particular set of files (the init scripts), we never successfully transfered to the Debian maintainers yet!

Per ticket #1454, we decided to remove the debian package files from the upstream source repository since those files were now being maintained by debian. This turns out to be partially mistaken, as this particular set of files (the init scripts), we never successfully transfered to the Debian maintainers yet!

Okay I created a branch in github, but it should not be merged to trunk because of #1454. As I said in the commit message, I'm creating this branch solely to give !Debian/Ubuntu/Tails packagers and us a shared codebase to point at and talk about:

https://github.com/zooko/tahoe-lafs/commit/cb6d458ab5c638f7b203ef07b91b4fb5873d91e0

Okay I created a branch in github, but it should *not* be merged to trunk because of #1454. As I said in the commit message, I'm creating this branch solely to give !Debian/Ubuntu/Tails packagers and us a shared codebase to point at and talk about: <https://github.com/zooko/tahoe-lafs/commit/cb6d458ab5c638f7b203ef07b91b4fb5873d91e0>
daira changed title from init scripts included in the Ubuntu apt-get install for tahoe-lafs to init scripts included in the apt-get install for tahoe-lafs on Debian/Ubuntu derivatives 2013-08-05 23:26:54 +00:00

Okay, I've posted to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003 asking the Debian maintainers to take over the init scripts. Closing this ticket as "Somebody Else's Problem".

Okay, I've posted to <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003> asking the Debian maintainers to take over the init scripts. Closing this ticket as "Somebody Else's Problem".
zooko added the
r/somebody else's problem
label 2013-08-27 14:55:26 +00:00
zooko closed this issue 2013-08-27 14:55:26 +00:00

I'm leaving this ticket closed, but here I'm posting a copy of my code-review of bertagaz's patch which is now in Debian.

Thank you for working on this! I just reviewed
http://anonscm.debian.org/gitweb/?p=tahoe/tahoe.git;a=blob;f=debian/README.Debian;h=14ea2a7c1b38d41df36dd052c44cdf22603fd775;hb=87f7666c2c3a5059dc28ea95c336b9de7f08ae47
. It is interesting that this is using the username within the local
operating system as the "nick". That isn't what we intended the
nickname to be for, but I don't see anything obviously wrong with it.
It means that the node will announce to everyone who connects to it
what the local username is. Is that what was expected?

Hm, actually now that I think this through, I think the human reading
that doc needs a warning about this! I think you should add a sentence
that says "This nickname will be announced to all participants in the
grid." or something like that. Or, change the suggested command-lines
so that it no longer fills in the "nick" field from the username.

I'm leaving this ticket closed, but here I'm posting a copy of my code-review of bertagaz's patch which is now in Debian. Thank you for working on this! I just reviewed <http://anonscm.debian.org/gitweb/?p=tahoe/tahoe.git;a=blob;f=debian/README.Debian;h=14ea2a7c1b38d41df36dd052c44cdf22603fd775;hb=87f7666c2c3a5059dc28ea95c336b9de7f08ae47> . It is interesting that this is using the username within the local operating system as the "nick". That isn't what we intended the nickname to be for, but I don't see anything obviously wrong with it. It means that the node will announce to everyone who connects to it what the local username is. Is that what was expected? Hm, actually now that I think this through, I think the human reading that doc needs a warning about this! I think you should add a sentence that says "This nickname will be announced to all participants in the grid." or something like that. Or, change the suggested command-lines so that it no longer fills in the "nick" field from the username.

Okay, I just reviewed
http://anonscm.debian.org/gitweb/?p=tahoe/tahoe.git;a=blob;f=debian/tahoe-lafs.init;h=13b505fb4b2d4be959e3df7edef02a369a48fc7c;hb=8428876521454b5fd2b0719048caf909c0ab68ee
. Here are my comments.

Thank you for working on this patch! I'm excited about making Tahoe-LAFS be a more first-class citizen of the Debian universe. A lot of good can come of this. Thank you for your contribution.

I don't understand why /etc/init.d/tahoe-lafs restart does tahoe stop ; sleep 1 ; tahoe start and /etc/init.d/tahoe-lafs force-reload does tahoe restart. I think both of those should do tahoe restart.

I think /etc/init.d/tahoe-lafs stop should do tahoe stop instead of kill cat twistd.pid``. That's because tahoe stop has a couple of features such as warning the user if the daemon doesn't stop after SIGKILL. See [the code here]source:trunk/src/allmydata/scripts/startstop_node.py?annotate=blame&rev=3ee950f09ed8b7f6cc72a98c26eefe9e02c11d85#L78.

Other than those two things, I didn't see anything strange or objectionable in this patch. Thanks again!

Okay, I just reviewed <http://anonscm.debian.org/gitweb/?p=tahoe/tahoe.git;a=blob;f=debian/tahoe-lafs.init;h=13b505fb4b2d4be959e3df7edef02a369a48fc7c;hb=8428876521454b5fd2b0719048caf909c0ab68ee> . Here are my comments. Thank you for working on this patch! I'm excited about making Tahoe-LAFS be a more first-class citizen of the Debian universe. A lot of good can come of this. Thank you for your contribution. I don't understand why `/etc/init.d/tahoe-lafs restart` does `tahoe stop ; sleep 1 ; tahoe start` and `/etc/init.d/tahoe-lafs force-reload` does `tahoe restart`. I think both of those should do `tahoe restart`. I think `/etc/init.d/tahoe-lafs stop` should do `tahoe stop` instead of `kill `cat twistd.pid``. That's because `tahoe stop` has a couple of features such as warning the user if the daemon doesn't stop after SIGKILL. See [the code here]source:trunk/src/allmydata/scripts/startstop_node.py?annotate=blame&rev=3ee950f09ed8b7f6cc72a98c26eefe9e02c11d85#L78. Other than those two things, I didn't see anything strange or objectionable in this patch. Thanks again!

I posted another, much bigger, review to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003 but I'm not copying it into this ticket, so go read that thread.

I posted another, much bigger, review to <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652003> but I'm not copying it into this ticket, so go read that thread.
Sign in to join this conversation.
No labels
c/code
c/code-dirnodes
c/code-encoding
c/code-frontend
c/code-frontend-cli
c/code-frontend-ftp-sftp
c/code-frontend-magic-folder
c/code-frontend-web
c/code-mutable
c/code-network
c/code-nodeadmin
c/code-peerselection
c/code-storage
c/contrib
c/dev-infrastructure
c/docs
c/operational
c/packaging
c/unknown
c/website
kw:2pc
kw:410
kw:9p
kw:ActivePerl
kw:AttributeError
kw:DataUnavailable
kw:DeadReferenceError
kw:DoS
kw:FileZilla
kw:GetLastError
kw:IFinishableConsumer
kw:K
kw:LeastAuthority
kw:Makefile
kw:RIStorageServer
kw:StringIO
kw:UncoordinatedWriteError
kw:about
kw:access
kw:access-control
kw:accessibility
kw:accounting
kw:accounting-crawler
kw:add-only
kw:aes
kw:aesthetics
kw:alias
kw:aliases
kw:aliens
kw:allmydata
kw:amazon
kw:ambient
kw:annotations
kw:anonymity
kw:anonymous
kw:anti-censorship
kw:api_auth_token
kw:appearance
kw:appname
kw:apport
kw:archive
kw:archlinux
kw:argparse
kw:arm
kw:assertion
kw:attachment
kw:auth
kw:authentication
kw:automation
kw:avahi
kw:availability
kw:aws
kw:azure
kw:backend
kw:backoff
kw:backup
kw:backupdb
kw:backward-compatibility
kw:bandwidth
kw:basedir
kw:bayes
kw:bbfreeze
kw:beta
kw:binaries
kw:binutils
kw:bitcoin
kw:bitrot
kw:blacklist
kw:blocker
kw:blocks-cloud-deployment
kw:blocks-cloud-merge
kw:blocks-magic-folder-merge
kw:blocks-merge
kw:blocks-raic
kw:blocks-release
kw:blog
kw:bom
kw:bonjour
kw:branch
kw:branding
kw:breadcrumbs
kw:brians-opinion-needed
kw:browser
kw:bsd
kw:build
kw:build-helpers
kw:buildbot
kw:builders
kw:buildslave
kw:buildslaves
kw:cache
kw:cap
kw:capleak
kw:captcha
kw:cast
kw:centos
kw:cffi
kw:chacha
kw:charset
kw:check
kw:checker
kw:chroot
kw:ci
kw:clean
kw:cleanup
kw:cli
kw:cloud
kw:cloud-backend
kw:cmdline
kw:code
kw:code-checks
kw:coding-standards
kw:coding-tools
kw:coding_tools
kw:collection
kw:compatibility
kw:completion
kw:compression
kw:confidentiality
kw:config
kw:configuration
kw:configuration.txt
kw:conflict
kw:connection
kw:connectivity
kw:consistency
kw:content
kw:control
kw:control.furl
kw:convergence
kw:coordination
kw:copyright
kw:corruption
kw:cors
kw:cost
kw:coverage
kw:coveralls
kw:coveralls.io
kw:cpu-watcher
kw:cpyext
kw:crash
kw:crawler
kw:crawlers
kw:create-container
kw:cruft
kw:crypto
kw:cryptography
kw:cryptography-lib
kw:cryptopp
kw:csp
kw:curl
kw:cutoff-date
kw:cycle
kw:cygwin
kw:d3
kw:daemon
kw:darcs
kw:darcsver
kw:database
kw:dataloss
kw:db
kw:dead-code
kw:deb
kw:debian
kw:debug
kw:deep-check
kw:defaults
kw:deferred
kw:delete
kw:deletion
kw:denial-of-service
kw:dependency
kw:deployment
kw:deprecation
kw:desert-island
kw:desert-island-build
kw:design
kw:design-review-needed
kw:detection
kw:dev-infrastructure
kw:devpay
kw:directory
kw:directory-page
kw:dirnode
kw:dirnodes
kw:disconnect
kw:discovery
kw:disk
kw:disk-backend
kw:distribute
kw:distutils
kw:dns
kw:do_http
kw:doc-needed
kw:docker
kw:docs
kw:docs-needed
kw:dokan
kw:dos
kw:download
kw:downloader
kw:dragonfly
kw:drop-upload
kw:duplicity
kw:dusty
kw:earth-dragon
kw:easy
kw:ec2
kw:ecdsa
kw:ed25519
kw:egg-needed
kw:eggs
kw:eliot
kw:email
kw:empty
kw:encoding
kw:endpoint
kw:enterprise
kw:enum34
kw:environment
kw:erasure
kw:erasure-coding
kw:error
kw:escaping
kw:etag
kw:etch
kw:evangelism
kw:eventual
kw:example
kw:excess-authority
kw:exec
kw:exocet
kw:expiration
kw:extensibility
kw:extension
kw:failure
kw:fedora
kw:ffp
kw:fhs
kw:figleaf
kw:file
kw:file-descriptor
kw:filename
kw:filesystem
kw:fileutil
kw:fips
kw:firewall
kw:first
kw:floatingpoint
kw:flog
kw:foolscap
kw:forward-compatibility
kw:forward-secrecy
kw:forwarding
kw:free
kw:freebsd
kw:frontend
kw:fsevents
kw:ftp
kw:ftpd
kw:full
kw:furl
kw:fuse
kw:garbage
kw:garbage-collection
kw:gateway
kw:gatherer
kw:gc
kw:gcc
kw:gentoo
kw:get
kw:git
kw:git-annex
kw:github
kw:glacier
kw:globalcaps
kw:glossary
kw:google-cloud-storage
kw:google-drive-backend
kw:gossip
kw:governance
kw:grid
kw:grid-manager
kw:gridid
kw:gridsync
kw:grsec
kw:gsoc
kw:gvfs
kw:hackfest
kw:hacktahoe
kw:hang
kw:hardlink
kw:heartbleed
kw:heisenbug
kw:help
kw:helper
kw:hint
kw:hooks
kw:how
kw:how-to
kw:howto
kw:hp
kw:hp-cloud
kw:html
kw:http
kw:https
kw:i18n
kw:i2p
kw:i2p-collab
kw:illustration
kw:image
kw:immutable
kw:impressions
kw:incentives
kw:incident
kw:init
kw:inlineCallbacks
kw:inotify
kw:install
kw:installer
kw:integration
kw:integration-test
kw:integrity
kw:interactive
kw:interface
kw:interfaces
kw:interoperability
kw:interstellar-exploration
kw:introducer
kw:introduction
kw:iphone
kw:ipkg
kw:iputil
kw:ipv6
kw:irc
kw:jail
kw:javascript
kw:joke
kw:jquery
kw:json
kw:jsui
kw:junk
kw:key-value-store
kw:kfreebsd
kw:known-issue
kw:konqueror
kw:kpreid
kw:kvm
kw:l10n
kw:lae
kw:large
kw:latency
kw:leak
kw:leasedb
kw:leases
kw:libgmp
kw:license
kw:licenss
kw:linecount
kw:link
kw:linux
kw:lit
kw:localhost
kw:location
kw:locking
kw:logging
kw:logo
kw:loopback
kw:lucid
kw:mac
kw:macintosh
kw:magic-folder
kw:manhole
kw:manifest
kw:manual-test-needed
kw:map
kw:mapupdate
kw:max_space
kw:mdmf
kw:memcheck
kw:memory
kw:memory-leak
kw:mesh
kw:metadata
kw:meter
kw:migration
kw:mime
kw:mingw
kw:minimal
kw:misc
kw:miscapture
kw:mlp
kw:mock
kw:more-info-needed
kw:mountain-lion
kw:move
kw:multi-users
kw:multiple
kw:multiuser-gateway
kw:munin
kw:music
kw:mutability
kw:mutable
kw:mystery
kw:names
kw:naming
kw:nas
kw:navigation
kw:needs-review
kw:needs-spawn
kw:netbsd
kw:network
kw:nevow
kw:new-user
kw:newcaps
kw:news
kw:news-done
kw:news-needed
kw:newsletter
kw:newurls
kw:nfc
kw:nginx
kw:nixos
kw:no-clobber
kw:node
kw:node-url
kw:notification
kw:notifyOnDisconnect
kw:nsa310
kw:nsa320
kw:nsa325
kw:numpy
kw:objects
kw:old
kw:openbsd
kw:openitp-packaging
kw:openssl
kw:openstack
kw:opensuse
kw:operation-helpers
kw:operational
kw:operations
kw:ophandle
kw:ophandles
kw:ops
kw:optimization
kw:optional
kw:options
kw:organization
kw:os
kw:os.abort
kw:ostrom
kw:osx
kw:osxfuse
kw:otf-magic-folder-objective1
kw:otf-magic-folder-objective2
kw:otf-magic-folder-objective3
kw:otf-magic-folder-objective4
kw:otf-magic-folder-objective5
kw:otf-magic-folder-objective6
kw:p2p
kw:packaging
kw:partial
kw:password
kw:path
kw:paths
kw:pause
kw:peer-selection
kw:performance
kw:permalink
kw:permissions
kw:persistence
kw:phone
kw:pickle
kw:pip
kw:pipermail
kw:pkg_resources
kw:placement
kw:planning
kw:policy
kw:port
kw:portability
kw:portal
kw:posthook
kw:pratchett
kw:preformance
kw:preservation
kw:privacy
kw:process
kw:profile
kw:profiling
kw:progress
kw:proxy
kw:publish
kw:pyOpenSSL
kw:pyasn1
kw:pycparser
kw:pycrypto
kw:pycrypto-lib
kw:pycryptopp
kw:pyfilesystem
kw:pyflakes
kw:pylint
kw:pypi
kw:pypy
kw:pysqlite
kw:python
kw:python3
kw:pythonpath
kw:pyutil
kw:pywin32
kw:quickstart
kw:quiet
kw:quotas
kw:quoting
kw:raic
kw:rainhill
kw:random
kw:random-access
kw:range
kw:raspberry-pi
kw:reactor
kw:readonly
kw:rebalancing
kw:recovery
kw:recursive
kw:redhat
kw:redirect
kw:redressing
kw:refactor
kw:referer
kw:referrer
kw:regression
kw:rekey
kw:relay
kw:release
kw:release-blocker
kw:reliability
kw:relnotes
kw:remote
kw:removable
kw:removable-disk
kw:rename
kw:renew
kw:repair
kw:replace
kw:report
kw:repository
kw:research
kw:reserved_space
kw:response-needed
kw:response-time
kw:restore
kw:retrieve
kw:retry
kw:review
kw:review-needed
kw:reviewed
kw:revocation
kw:roadmap
kw:rollback
kw:rpm
kw:rsa
kw:rss
kw:rst
kw:rsync
kw:rusty
kw:s3
kw:s3-backend
kw:s3-frontend
kw:s4
kw:same-origin
kw:sandbox
kw:scalability
kw:scaling
kw:scheduling
kw:schema
kw:scheme
kw:scp
kw:scripts
kw:sdist
kw:sdmf
kw:security
kw:self-contained
kw:server
kw:servermap
kw:servers-of-happiness
kw:service
kw:setup
kw:setup.py
kw:setup_requires
kw:setuptools
kw:setuptools_darcs
kw:sftp
kw:shared
kw:shareset
kw:shell
kw:signals
kw:simultaneous
kw:six
kw:size
kw:slackware
kw:slashes
kw:smb
kw:sneakernet
kw:snowleopard
kw:socket
kw:solaris
kw:space
kw:space-efficiency
kw:spam
kw:spec
kw:speed
kw:sqlite
kw:ssh
kw:ssh-keygen
kw:sshfs
kw:ssl
kw:stability
kw:standards
kw:start
kw:startup
kw:static
kw:static-analysis
kw:statistics
kw:stats
kw:stats_gatherer
kw:status
kw:stdeb
kw:storage
kw:streaming
kw:strports
kw:style
kw:stylesheet
kw:subprocess
kw:sumo
kw:survey
kw:svg
kw:symlink
kw:synchronous
kw:tac
kw:tahoe-*
kw:tahoe-add-alias
kw:tahoe-admin
kw:tahoe-archive
kw:tahoe-backup
kw:tahoe-check
kw:tahoe-cp
kw:tahoe-create-alias
kw:tahoe-create-introducer
kw:tahoe-debug
kw:tahoe-deep-check
kw:tahoe-deepcheck
kw:tahoe-lafs-trac-stream
kw:tahoe-list-aliases
kw:tahoe-ls
kw:tahoe-magic-folder
kw:tahoe-manifest
kw:tahoe-mkdir
kw:tahoe-mount
kw:tahoe-mv
kw:tahoe-put
kw:tahoe-restart
kw:tahoe-rm
kw:tahoe-run
kw:tahoe-start
kw:tahoe-stats
kw:tahoe-unlink
kw:tahoe-webopen
kw:tahoe.css
kw:tahoe_files
kw:tahoewapi
kw:tarball
kw:tarballs
kw:tempfile
kw:templates
kw:terminology
kw:test
kw:test-and-set
kw:test-from-egg
kw:test-needed
kw:testgrid
kw:testing
kw:tests
kw:throttling
kw:ticket999-s3-backend
kw:tiddly
kw:time
kw:timeout
kw:timing
kw:to
kw:to-be-closed-on-2011-08-01
kw:tor
kw:tor-protocol
kw:torsocks
kw:tox
kw:trac
kw:transparency
kw:travis
kw:travis-ci
kw:trial
kw:trickle
kw:trivial
kw:truckee
kw:tub
kw:tub.location
kw:twine
kw:twistd
kw:twistd.log
kw:twisted
kw:twisted-14
kw:twisted-trial
kw:twitter
kw:twn
kw:txaws
kw:type
kw:typeerror
kw:ubuntu
kw:ucwe
kw:ueb
kw:ui
kw:unclean
kw:uncoordinated-writes
kw:undeletable
kw:unfinished-business
kw:unhandled-error
kw:unhappy
kw:unicode
kw:unit
kw:unix
kw:unlink
kw:update
kw:upgrade
kw:upload
kw:upload-helper
kw:uri
kw:url
kw:usability
kw:use-case
kw:utf-8
kw:util
kw:uwsgi
kw:ux
kw:validation
kw:variables
kw:vdrive
kw:verify
kw:verlib
kw:version
kw:versioning
kw:versions
kw:video
kw:virtualbox
kw:virtualenv
kw:vista
kw:visualization
kw:visualizer
kw:vm
kw:volunteergrid2
kw:volunteers
kw:vpn
kw:wapi
kw:warners-opinion-needed
kw:warning
kw:weapi
kw:web
kw:web.port
kw:webapi
kw:webdav
kw:webdrive
kw:webport
kw:websec
kw:website
kw:websocket
kw:welcome
kw:welcome-page
kw:welcomepage
kw:wiki
kw:win32
kw:win64
kw:windows
kw:windows-related
kw:winscp
kw:workaround
kw:world-domination
kw:wrapper
kw:write-enabler
kw:wui
kw:x86
kw:x86-64
kw:xhtml
kw:xml
kw:xss
kw:zbase32
kw:zetuptoolz
kw:zfec
kw:zookos-opinion-needed
kw:zope
kw:zope.interface
p/blocker
p/critical
p/major
p/minor
p/normal
p/supercritical
p/trivial
r/cannot reproduce
r/duplicate
r/fixed
r/invalid
r/somebody else's problem
r/was already fixed
r/wontfix
r/worksforme
t/defect
t/enhancement
t/task
v/0.2.0
v/0.3.0
v/0.4.0
v/0.5.0
v/0.5.1
v/0.6.0
v/0.6.1
v/0.7.0
v/0.8.0
v/0.9.0
v/1.0.0
v/1.1.0
v/1.10.0
v/1.10.1
v/1.10.2
v/1.10a2
v/1.11.0
v/1.12.0
v/1.12.1
v/1.13.0
v/1.14.0
v/1.15.0
v/1.15.1
v/1.2.0
v/1.3.0
v/1.4.1
v/1.5.0
v/1.6.0
v/1.6.1
v/1.7.0
v/1.7.1
v/1.7β
v/1.8.0
v/1.8.1
v/1.8.2
v/1.8.3
v/1.8β
v/1.9.0
v/1.9.0-s3branch
v/1.9.0a1
v/1.9.0a2
v/1.9.0b1
v/1.9.1
v/1.9.2
v/1.9.2a1
v/cloud-branch
v/unknown
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac#961
No description provided.