Having a startup script (rc3.d) startup under another id

Having a startup script (rc3.d) startup under another id

Post by Michae » Wed, 14 Nov 2001 22:33:50



I have a startup script that located in /etc/rc3.d  that gets started
everytime the
system reboots. I would like it to get started NOT with the root id but with
ANOTHER  id
on the system.

Does anyone know how I should specify this ?

Thanks in advance!

 
 
 

Having a startup script (rc3.d) startup under another id

Post by -- mouse - » Wed, 14 Nov 2001 19:39:53



Quote:

> I have a startup script that located in /etc/rc3.d  that gets started
> everytime the
> system reboots. I would like it to get started NOT with the root id but
with
> ANOTHER  id
> on the system.

> Does anyone know how I should specify this ?

change the script to run like:

case $1 in
start)
            su newuser -c "/the/command/to/run" ;;
esac

 
 
 

1. Place startup script in rc3.d - NOT WORKING - Help

all,

I am trying to install a startup script "Sxxxx" that will change
ownership of a devices file to bin.  It would appear that the script is
executing however when I check on the devices file that the script was
supposed to change to bin it didn't.

I have run this from the CLI and it works fine - I placed this under
/etc/rc3.d/S12xxxxx... and have not been able to figure out why this
isn't working.  I am running under Solaris 2.6 on an Ultra Server. Here
is the snippet of code that I need to work:

#!/bin/sh
# change ownership of /dev/sound/0
PATH=/bin:/usr/sbin:/usr/bin:/usr/etc:/usr/ucb:$PATH
export PATH

# check the uid to make sure user is root
CheckUID() {

    CUR_UID=`/bin/id | sed -e 's/(.*$//' -e 's/^.*=//'`;
    if [ $CUR_UID != 0 ] ; then
        echo "Only root (UID=0) can run this script. Exiting."
        exit 1
    fi
    unset CUR_UID
    return 0

CheckUID
echo "Changing /dev/sound/0 ownership to bin...."

when I perform an ownership check, it is still owned by root not bin.
It appears something is either wrong in my script or something is
changing it back to root after my script.

Any ideas...
Mike

2. upgrade Solaris 2.5.1 to 2.6

3. Startup Script in /etc/rc.d/rc3.d Doesn't Seem to Work.

4. NIS_PATH

5. problem with startup script in rc3.d directory

6. rusage on arbitrary processes

7. rc3.d process startup with user other than root

8. full-duplex hme <-> Cisco 5000

9. Startup quirk with rc3 but behaviour is normal !?!!

10. automatic startup of services during the system's startup

11. Job Offer: IP storage startup Silicon Valley startup

12. SSL Apache Server startup requires password on startup

13. Job Offer: IP storage startup Silicon Valley startup