[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Scripts in /etc/init.d Question and Comment.



There is something that has always bothered me about the scripts in
`/etc/init.d'. Every once in a while I attempt to execute one of these
scripts while logged in as a non-root user. For example, I might type
`/etc/init.d/foobar restart' while having the privileges of user `jps'
(uid=1000). Normally, as the administrator, I would preface the
previous text with the `sudo' command. Sometimes I forget, and as a
result, I get all kinds of bogus garbage printed to my error channel;
and it takes me a confused moment to figure out what went wrong. Try
it with your favorite init.d script today! I have a simple suggested
solution that might help alleviate this awkwardness (without obliging
me to raise my awareness!). How about prefacing the scripts in
`/etc/init.d' with something along the lines of:

	if [ ! $EUID == 0 ]; then
		echo "Sorry, this script must run with root privileges."
	if

I am not sure why the script writers do not include something like
this in all of the init.d scripts. Unless I am overlooking something
obvious, maybe we can include this type of thing in debian policy?
-- 
Jean-Paul Stewart

Attachment: pgpFCvGr81TKE.pgp
Description: PGP signature


Reply to: