Subject: set-uid scripts
To: None <current-users@netbsd.org>
From: David Forbes <david@flossy.u-net.com>
List: current-users
Date: 10/30/1999 22:12:47
Summary: I'd really like to be able to execute a script at start up as a
user other than root.  Easy I thought: chmod u+s.  However, top suggests
otherwise.  How can I get around this?

Detail:

I've got a short script that needs to run continuously and which there
must only ever be one instance of.  I'd rather it didn't run as root, for
various reason including tidiness and security.  I thought I'd be able to
reference it in /etc/rc.local in the usual manner and then chmod u+s to
get the correct user id.

The script itself supervises a set of other processes which actually do
the work.  It was originally written in perl, but I've tried it as a bash
script.

The thing is, I feel sure that I achieved something similar under 1.3 a
while ago (around 1.3H, ISTR), but I could have been imaging it.

Is there a good reliable way of doing this?

Thanks,

David.