Debian Bug report logs - #652355
git-daemon-sysvinit: requires a switch to be flipped before it works

version graph

Package: git-daemon-sysvinit; Maintainer for git-daemon-sysvinit is Jonathan Nieder <[email protected]>; Source for git-daemon-sysvinit is src:git (PTS, buildd, popcon).

Reported by: Jonathan Nieder <[email protected]>

Date: Fri, 16 Dec 2011 15:42:55 UTC

Severity: wishlist

Tags: patch

Found in version git/1:1.7.7.3-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Fri, 16 Dec 2011 15:42:58 GMT) (full text, mbox, link).


Acknowledgement sent to Jonathan Nieder <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], Gerrit Pape <[email protected]>. (Fri, 16 Dec 2011 15:42:58 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Jonathan Nieder <[email protected]>
To: [email protected]
Subject: git-daemon-sysvinit: requires a switch to be flipped before it works
Date: Fri, 16 Dec 2011 09:18:11 -0600
Package: git-daemon-sysvinit
Version: 1:1.7.7.3-1
Severity: wishlist
Tags: patch

Hi Daniel,

When you submitted the /etc/init.d/git-daemon patch, I encouraged
adding a GIT_DAEMON_ENABLE knob so the sysadmin can put

	GIT_DAEMON_ENABLE=false

in /etc/default/git-daemon, then install git-daemon-sysvinit, and
then only enable the daemon once everything is configured properly.

But that was silly of me.  If someone wants to configure git-daemon
before installing it, she can do so by putting conffiles in place
in advance.  The ENABLE knob is not needed for that.

Looking at it from the other side, the package would be more intuitive
and user-friendly if it were not required to flip a switch mentioned
in the README file before it started to work.  And "invoke-rc.d <foo>
disable" is a much nicer interface for turning off an init script.

How about something like this patch?
---
 debian/changelog                         |   11 +++++++++++
 debian/git-daemon-sysvinit.README.Debian |   13 ++++---------
 debian/git-daemon.default                |    1 -
 debian/git-daemon.init                   |    8 +-------
 4 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 53036207..eb1e5ec7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+git (1:1.7.8-1.1) unstable; urgency=low
+
+  * make git-daemon-sysvinit work out of the box.
+    * debian/git-daemon.init, debian/git-daemon.default: remove
+      GIT_DAEMON_ENABLE setting.
+    * debian/git-daemon-sysvinit.README.Debian: update now that
+      the daemon starts by default; explain how to use "invoke-rc.d
+      disable" to disable the service.
+
+ -- Jonathan Nieder <[email protected]>  Fri, 16 Dec 2011 09:08:54 -0600
+
 git (1:1.7.8-1) unstable; urgency=low
 
   * merge branch debian-experimental.
diff --git a/debian/git-daemon-sysvinit.README.Debian b/debian/git-daemon-sysvinit.README.Debian
index 320d7001..13a302d9 100644
--- a/debian/git-daemon-sysvinit.README.Debian
+++ b/debian/git-daemon-sysvinit.README.Debian
@@ -4,18 +4,13 @@ git-daemon-sysvinit for Debian
 This package enables a git-daemon service.  This allows people to use a
 git:// URL to access your repositories.
 
-After installing this package, the daemon needs to be enabled in
-/etc/default/git-daemon by setting:
+The git daemon can be stopped with:
 
-  GIT_DAEMON_ENABLE=false
+  # /etc/init.d/git-daemon stop
 
-to:
+To disable it until explicitly re-enabled, use:
 
-  GIT_DAEMON_ENABLE=true
-
-After that, the git daemon can be started with:
-
-  # /etc/init.d/git-daemon start
+  # update-rc.d git-daemon disable
 
 The git daemon by default looks into the directory /var/cache/git/ for
 repositories (this is configured in /etc/default/git-daemon).  It expects
diff --git a/debian/git-daemon.default b/debian/git-daemon.default
index 20208055..6f62b0c8 100644
--- a/debian/git-daemon.default
+++ b/debian/git-daemon.default
@@ -6,7 +6,6 @@
 # This is a POSIX shell fragment
 #
 
-GIT_DAEMON_ENABLE=false
 GIT_DAEMON_USER=gitdaemon
 GIT_DAEMON_DIRECTORY=/var/cache/git
 
diff --git a/debian/git-daemon.init b/debian/git-daemon.init
index 0e97c431..c5988423 100644
--- a/debian/git-daemon.init
+++ b/debian/git-daemon.init
@@ -76,13 +76,7 @@ do_stop()
 
 case "$1" in
   start)
-    if [ $GIT_DAEMON_ENABLE = true ]; then
-	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
-    else
-	[ "$VERBOSE" != no ] && log_warning_msg "$NAME not enabled in /etc/default/$NAME, not starting..."
-	exit 0
-    fi
-
+    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
     do_start
     case "$?" in
 		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-- 
1.7.8





Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Fri, 06 Jan 2012 17:12:08 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Fri, 06 Jan 2012 17:12:08 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Daniel Baumann <[email protected]>
To: Jonathan Nieder <[email protected]>
Cc: [email protected]
Subject: Re: git-daemon-sysvinit: requires a switch to be flipped before it
Date: Fri, 06 Jan 2012 18:10:32 +0100
sorry for the late answer.

first, the enable flag (and having it by default set to false is) is in 
general a good thing. that way, a daemon does need to get manually 
enabled by the admin. this appears to be specifically nice for daemons 
such as git-daemon which might "suddenly" expose users data that he did 
not necessarily want to in the first place. also, having no way to 
disable the daemon but keeping it installed would be bad.

having said that, for git-daemon-sysvinit, the package doesn't actually 
contain the daemon binaries but only the sysvinit integration, so it's 
not necessarily required to have a switch off flag, a 'dpkg -P 
git-daemon-sysvinit' or 'update-rc.d disable [...]' call would be 
aequivalent. if a enabled=true/false flag should be kept for 
convenience, rather than to trigger sysvinit or even packaging changes, 
is your call.

the potential automatic exposure of user data doesn't seem to much of an 
issue here, as git-daemon-sysvinit explicitly needs to be installed, 
and, even if installed and enabled, it still needs to have a) some 
repositories in the default location /var/cache/git *and* b) an 
'attacker' would need to know the exact repo location.

[ unrelated to that, git-daemon-sysvinit actually doesn't work in the 
default case anyway, due to a bug with the basepath, i'll send a patch 
for that later these days; i had that in the original patch, but it got 
dropped after some time during the process of getting it merged in the 
git package itself. ]

or in other words, i personally don't really mind if there's a enable 
flag or not.

if you intend to keep it, it should have a debconf question (priority 
low) so that the package can be preseeded. this also holds true for the 
directory location.

would you accept patches to add that support (for the directory 
question, and, if you choose to keep it, also for the enable flag)?

Regards,
Daniel

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          [email protected]
Internet:       http://people.progress-technologies.net/~daniel.baumann/




Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Fri, 06 Jan 2012 17:21:03 GMT) (full text, mbox, link).


Acknowledgement sent to Jonathan Nieder <[email protected]>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Fri, 06 Jan 2012 17:21:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Jonathan Nieder <[email protected]>
To: Daniel Baumann <[email protected]>
Cc: [email protected]
Subject: Re: git-daemon-sysvinit: requires a switch to be flipped before it
Date: Fri, 6 Jan 2012 11:17:24 -0600
Hi Daniel,

Daniel Baumann wrote:

>              if a enabled=true/false flag should be kept for convenience,
> rather than to trigger sysvinit or even packaging changes, is your call.

No, it's your call.

[...]
> would you accept patches to add that support (for the directory question,
> and, if you choose to keep it, also for the enable flag)?

I will accept any patches from you or approved by you concerning the
git-daemon-sysvinit package, unless they seem insane.  It's yours. :)
(Of course Gerrit still has his say as co-maintainer.)

If I send a suggestion that seems like a bad idea to you, you can even
simply close it.

Thanks,
Jonathan




Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Fri, 06 Jan 2012 17:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Fri, 06 Jan 2012 17:27:03 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Daniel Baumann <[email protected]>
To: Jonathan Nieder <[email protected]>
Cc: [email protected]
Subject: Re: git-daemon-sysvinit: requires a switch to be flipped before it
Date: Fri, 06 Jan 2012 18:23:06 +0100
On 01/06/2012 06:17 PM, Jonathan Nieder wrote:
>>               if a enabled=true/false flag should be kept for convenience,
>> rather than to trigger sysvinit or even packaging changes, is your call.
>
> No, it's your call.

i personally, for the interest of keeping daemon configs on the 
principle of last surprise, and in the absent of any better debian-wide 
unified mechanism for having a way to enable/disable daemons, i would 
keep it, add a debconf question for it at priority low and defaulting to 
yes. to me, that sounds like the best solution atm.

> I will accept any patches from you or approved by you concerning the
> git-daemon-sysvinit package, unless they seem insane.

heh, ok :)

i'll prepare a patch doing above then and attach it to this bug report 
(probably tomorrow).

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          [email protected]
Internet:       http://people.progress-technologies.net/~daniel.baumann/




Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Thu, 21 Nov 2013 22:51:10 GMT) (full text, mbox, link).


Acknowledgement sent to Antonio Ospite <[email protected]>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Thu, 21 Nov 2013 22:51:10 GMT) (full text, mbox, link).


Message #25 received at [email protected] (full text, mbox, reply):

From: Antonio Ospite <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Re: git-daemon-sysvinit: requires a switch to be flipped before it works
Date: Thu, 21 Nov 2013 23:48:13 +0100
Package: git-daemon-sysvinit
Followup-For: Bug #652355

Dear Maintainer,

FWIW I too think that GIT_DAEMON_ENABLE=false is a good idea.
So I'd leave it just as it is now.

In my use case I have git repositories under /home/git/repositories, and being
forced to look at /etc/default/git-daemon in order to enabled and configure
the paths saved me some time I would have spent wondering around to see where
to configure things.

Thanks,
   Antonio

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (900, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12.0-ao2 (SMP w/1 CPU core)
Locale: LANG=it_IT.utf8, LC_CTYPE=it_IT.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages git-daemon-sysvinit depends on:
ii  adduser  3.113+nmu3
ii  git      1:1.8.4.3-1

git-daemon-sysvinit recommends no packages.

git-daemon-sysvinit suggests no packages.

-- no debconf information



Information forwarded to [email protected], Gerrit Pape <[email protected]>:
Bug#652355; Package git-daemon-sysvinit. (Tue, 04 Feb 2020 21:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Andreas Henriksson <[email protected]>:
Extra info received and forwarded to list. Copy sent to Gerrit Pape <[email protected]>. (Tue, 04 Feb 2020 21:27:03 GMT) (full text, mbox, link).


Message #30 received at [email protected] (full text, mbox, reply):

From: Andreas Henriksson <[email protected]>
To: [email protected]
Subject: Re: git-daemon-sysvinit: requires a switch to be flipped before it works
Date: Tue, 4 Feb 2020 22:25:51 +0100
Hello,

https://lintian.debian.org/tags/init.d-script-should-always-start-service.html

Please get rid of the variable in favour of using the handling
described in debian policy.

eg. user can override things via policy-rc.d and if you don't want to
have the service started/enabled by default then use the --no-start and
--no-enable flags to the relevant debhelpers.

Regards,
Andreas Henriksson



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon Nov 11 15:12:40 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.