Debian Bug report logs - #229972
invoke-rc.d: could check for root

version graph

Package: init-system-helpers; Maintainer for init-system-helpers is Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org>; Source for init-system-helpers is src:init-system-helpers (PTS, buildd, popcon).

Reported by: Adam Byrtek <alpha@debian.org>

Date: Tue, 27 Jan 2004 19:03:02 UTC

Severity: wishlist

Tags: wontfix

Found in version init-system-helpers/1.25

Done: Christian Hofstaedtler <zeha@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Miquel van Smoorenburg <miquels@cistron.nl>:
Bug#229972; Package sysv-rc. (full text, mbox, link).


Acknowledgement sent to Adam Byrtek <alpha@debian.org>:
New Bug report received and forwarded. Copy sent to Miquel van Smoorenburg <miquels@cistron.nl>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Adam Byrtek <alpha@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: invoke-rc.d could check for root
Date: Tue, 27 Jan 2004 19:46:42 +0100
Package: sysv-rc
Version: 2.85-9
Severity: wishlist

In my opinion invoke-rc.d should check if it is run with correct
privileges, it's just a matter of simple:

  if [ "`id -u`" != "0" ]; then 
  ....

and it fixes strange behaviour like:

---cut---
~% invoke-rc.d fetchmail restart
Restarting mail retrieval agent: system-wide fetchmail not configured.
~% sudo invoke-rc.d fetchmail restart
Password:
Restarting mail retrieval agent: fetchmail.
---cut---

IMO it is better to get "Must run as root" message (or something
similar), than "fetchmail not configured", which is on course not
true.

Regards
Adam
alpha@debian.org


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux mentat 2.4.22 #1 śro gru 3 18:00:19 CET 2003 i686
Locale: LANG=pl_PL, LC_CTYPE=pl_PL

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#229972; Package sysv-rc. (full text, mbox, link).


Acknowledgement sent to Miquel van Smoorenburg <miquels@cistron.nl>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #10 received at 229972@bugs.debian.org (full text, mbox, reply):

From: Miquel van Smoorenburg <miquels@cistron.nl>
To: Adam Byrtek <alpha@debian.org>, 229972@bugs.debian.org
Subject: Re: Bug#229972: invoke-rc.d could check for root
Date: Thu, 29 Jan 2004 01:02:31 +0100
On Tue, 27 Jan 2004 19:46:42, Adam Byrtek wrote:
> Package: sysv-rc
> Version: 2.85-9
> Severity: wishlist
> 
> In my opinion invoke-rc.d should check if it is run with correct
> privileges, it's just a matter of simple:
> 
>   if [ "`id -u`" != "0" ]; then 
>   ....
> 
> and it fixes strange behaviour like:
> 
> ---cut---
> ~% invoke-rc.d fetchmail restart
> Restarting mail retrieval agent: system-wide fetchmail not configured.
> ~% sudo invoke-rc.d fetchmail restart
> Password:
> Restarting mail retrieval agent: fetchmail.
> ---cut---
> 
> IMO it is better to get "Must run as root" message (or something
> similar), than "fetchmail not configured", which is on course not
> true.

You do have a point there, but I'm not sure it's invoke-rc.d's fault.
I never use invoke-rc.d for starting services by hand; I always do
/etc/init.d/whatever start. That would result in the same error message.
The bug, therefore, is not in invoke-rc.d, but in fetchmail.

Either that, or you should send in a proposal to make it debian-policy
that all /etc/init.d/* scripts should check if the user has sufficient
priviliges before actually doing anything (which would't be a bad idea).

Can I close this bug ?

Mike.



Information forwarded to debian-bugs-dist@lists.debian.org, Miquel van Smoorenburg <miquels@cistron.nl>:
Bug#229972; Package sysv-rc. (full text, mbox, link).


Acknowledgement sent to Adam Byrtek / alpha <alpha@debian.org>:
Extra info received and forwarded to list. Copy sent to Miquel van Smoorenburg <miquels@cistron.nl>. (full text, mbox, link).


Message #15 received at 229972@bugs.debian.org (full text, mbox, reply):

From: Adam Byrtek / alpha <alpha@debian.org>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: 229972@bugs.debian.org
Subject: Re: Bug#229972: invoke-rc.d could check for root
Date: Thu, 29 Jan 2004 13:14:23 +0100
On Thu, Jan 29, 2004 at 01:02:31AM +0100, Miquel van Smoorenburg wrote:
> You do have a point there, but I'm not sure it's invoke-rc.d's fault.
> I never use invoke-rc.d for starting services by hand; I always do
> /etc/init.d/whatever start. That would result in the same error message.

I always thought that invoke-rc.d is the recomended wrapper, like
update-rc.d, moreover i use it because it is shorter to type and
tab-complete :)

> The bug, therefore, is not in invoke-rc.d, but in fetchmail.

So not only in fetchmail, but also in every other init-script. I think
it is easier to implement it in invoke-rc.d than to modify every
init-script in Debian.

Novices will se the correct error message when using invoke-rc.d
(according to tutorials) and power-users won't be confused when they
run /etc/init.d/foobar, because they know they must be root.

BTW look what I've just found:
http://www.debian.org/doc/debian-policy/footnotes.html

---cut---
46
In the future, the use of invoke-rc.d to invoke initscripts shall be
made mandatory. Maintainers are advised to switch to invoke-rc.d as
soon as possible.
---cut---

> Can I close this bug ?

It's your decision...

Regards
Adam

-- 

  _.|._ |_  _.   :  Adam Byrtek /alpha               alpha@debian.org
 (_|||_)| |(_|   :                                   pgp 0xB25952C0
     |           



Information forwarded to debian-bugs-dist@lists.debian.org, Miquel van Smoorenburg <miquels@cistron.nl>:
Bug#229972; Package sysv-rc. (full text, mbox, link).


Acknowledgement sent to Adam Byrtek / alpha <alpha@debian.org>:
Extra info received and forwarded to list. Copy sent to Miquel van Smoorenburg <miquels@cistron.nl>. (full text, mbox, link).


Message #20 received at 229972@bugs.debian.org (full text, mbox, reply):

From: Adam Byrtek / alpha <alpha@debian.org>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: 229972@bugs.debian.org
Subject: Re: Bug#229972: invoke-rc.d could check for root
Date: Thu, 29 Jan 2004 13:14:58 +0100
On Thu, Jan 29, 2004 at 01:02:31AM +0100, Miquel van Smoorenburg wrote:
> Can I close this bug ?

BTW you can always post to debian-devel if you are not sure about
this...

-- 

  _.|._ |_  _.   :  Adam Byrtek /alpha               alpha@debian.org
 (_|||_)| |(_|   :                                   pgp 0xB25952C0
     |           



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#229972; Package sysv-rc. (full text, mbox, link).


Acknowledgement sent to Miquel van Smoorenburg <miquels@cistron.nl>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #25 received at 229972@bugs.debian.org (full text, mbox, reply):

From: Miquel van Smoorenburg <miquels@cistron.nl>
To: Adam Byrtek / alpha <alpha@debian.org>, 229972@bugs.debian.org
Subject: Re: Bug#229972: invoke-rc.d could check for root
Date: Thu, 29 Jan 2004 14:49:01 +0100
On 2004.01.29 13:14, Adam Byrtek / alpha wrote:
> On Thu, Jan 29, 2004 at 01:02:31AM +0100, Miquel van Smoorenburg wrote:
> > You do have a point there, but I'm not sure it's invoke-rc.d's fault.
> > I never use invoke-rc.d for starting services by hand; I always do
> > /etc/init.d/whatever start. That would result in the same error message.
> 
> I always thought that invoke-rc.d is the recomended wrapper, like
> update-rc.d, moreover i use it because it is shorter to type and
> tab-complete :)

It's not, because invoke-rc.d only starts/stops services when they are
defined as active (start link in this runlevel). So when you want to start
a service that isn't active in the current runlevel, invoke-rc.d won't
let you ....

> > The bug, therefore, is not in invoke-rc.d, but in fetchmail.
> 
> So not only in fetchmail, but also in every other init-script. I think
> it is easier to implement it in invoke-rc.d than to modify every
> init-script in Debian.
> 
> Novices will se the correct error message when using invoke-rc.d
> (according to tutorials) and power-users won't be confused when they
> run /etc/init.d/foobar, because they know they must be root.
> 
> BTW look what I've just found:
> http://www.debian.org/doc/debian-policy/footnotes.html
> 
> ---cut---
> 46
> In the future, the use of invoke-rc.d to invoke initscripts shall be
> made mandatory. Maintainers are advised to switch to invoke-rc.d as
> soon as possible.
> ---cut---

This should be interpreted in the context of "maintainer scripts",
i.e. preinst/postinst etc. It doesn't mean it will become mandatory
for manual use. If anything, I'd expect a redhat "service" command to
take that place (though I think the name "service" is too broad, it
pollutes the command-namespace, iow "fat chance").

But feel free to file a wishlist bug instead saying "initscripts should
contain the "service" command (like redhat) to execute /etc/init.d
scripts, and it should check if you're root as well".

Mike.



Tags added: wontfix Request was from Thomas Hood <jdthood@yahoo.co.uk> to control@bugs.debian.org. (full text, mbox, link).


Changed Bug title to 'invoke-rc.d: could check for root' from 'invoke-rc.d could check for root' Request was from Andreas Henriksson <andreas@fatal.se> to control@bugs.debian.org. (Mon, 18 Jan 2016 17:53:03 GMT) (full text, mbox, link).


Bug reassigned from package 'sysv-rc' to 'init-system-helpers'. Request was from Andreas Henriksson <andreas@fatal.se> to control@bugs.debian.org. (Mon, 18 Jan 2016 17:53:04 GMT) (full text, mbox, link).


No longer marked as found in versions 2.85-9. Request was from Andreas Henriksson <andreas@fatal.se> to control@bugs.debian.org. (Mon, 18 Jan 2016 17:53:04 GMT) (full text, mbox, link).


Marked as found in versions init-system-helpers/1.25. Request was from Andreas Henriksson <andreas@fatal.se> to control@bugs.debian.org. (Mon, 18 Jan 2016 17:53:04 GMT) (full text, mbox, link).


Reply sent to Christian Hofstaedtler <zeha@debian.org>:
You have taken responsibility. (Sat, 10 Dec 2016 21:09:06 GMT) (full text, mbox, link).


Notification sent to Adam Byrtek <alpha@debian.org>:
Bug acknowledged by developer. (Sat, 10 Dec 2016 21:09:06 GMT) (full text, mbox, link).


Message #40 received at 229972-close@bugs.debian.org (full text, mbox, reply):

From: Christian Hofstaedtler <zeha@debian.org>
To: 229972-close@bugs.debian.org
Subject: Re: #229972: invoke-rc.d: could check for root
Date: Sat, 10 Dec 2016 22:06:31 +0100
As this bug states, invoke-rc.d is for maintainer scripts or other
automated uses, which can just be configured correctly.
Also, /sbin/service has appeared in the meantime, which, at least
with systemd (by forwarding) asks for authentication for non-root.

-- 
christian hofstaedtler <zeha@debian.org>



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 08 Jan 2017 07:31:32 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 5 23:20:46 2018; Machine Name: beach

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.