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

2002-04-08 Thread Jeroen Dekkers
On Sun, Apr 07, 2002 at 07:35:57PM -0400, JPS wrote: > 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'

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

2002-04-08 Thread Miquel van Smoorenburg
In article <[EMAIL PROTECTED]>, JPS <[EMAIL PROTECTED]> wrote: >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. This is Unix. It gives you enough rope to hang y

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

2002-04-08 Thread Colin Watson
On Mon, Apr 08, 2002 at 03:36:17AM -0300, Henrique de Moraes Holschuh wrote: > On Sun, 07 Apr 2002, JPS wrote: > > `/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 > ... > > The problem is, the initscri

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

2002-04-08 Thread Henrique de Moraes Holschuh
On Sun, 07 Apr 2002, JPS wrote: > `/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 ... The problem is, the initscript should actually check if it has the rights it needs, if it is to do what you want...

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

2002-04-08 Thread Mark Eichin
$EUID is a bash-ism; you'd need to run "id" instead. Also, the echo should include the name of the script... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

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

2002-04-08 Thread Aaron Schrab
At 19:35 -0400 07 Apr 2002, JPS <[EMAIL PROTECTED]> wrote: > 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 If

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

2002-04-07 Thread JPS
On Sun, Apr 07, 2002 at 07:35:57PM -0400, jpstewart wrote: > if [ ! $EUID == 0 ]; then > echo "Sorry, this script must run with root privileges." > if Oops. I forget to add the `exit 69' or whatever error code. -- Jean-Paul Stewart pgpnpQJPMuk43.pgp Description: PGP sig

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

2002-04-07 Thread JPS
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). Normall