Solved

Start process with specific id at bootime -Solaris 2.6

Posted on 2000-05-06
3
290 Views
Last Modified: 2013-12-27
On solaris 2.6 (sparc)I have Apache firing up from the /etc/rc3.d directory.

I need to start a process for some webtools at bootime as well, with a specific userid?
eg sysadmin

The syntax to start manually is....
/usr/local/apache/virtualhosts/webtools/bin/apachetcl start
This script is owned by root

How can this be done...thanks in advance
0
Comment
Question by:hyphen
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
festive earned 200 total points
ID: 2783894
sounds like what you need is a SETUID
script, if I follow what you are saying correctly, then this is what you need..

Key things to remember : when you name the script /etc/rc3.d/S90webutils (etc)
you must start it AFTER apache, so pick a higher number than apaches (ie the 90 should be high enough)
Benefits of using the "su" method are that the process will inherit the login environment of the sysadmin user - this could be usefull if you have environment variables which others are changing and you don't want to keep updating the script.

Hope this helps

#!/bin/sh -p
# setuid shell script to start Apache and Web Tools
# install into /etc/rc3.d
# make owner "sysadmin"
# make group "bin"
# run chmod 4750 on the file (setuid)
# This will start the programs as "sysadmin"
echo "`date`: web started" >> /usr/local/logs/webstart.log
# now start apache as "sysadmin"
/usr/local/apache/virtualhosts/webtools/bin/apachetcl start
# optionally you could run the script as root
# and start with an su command like:
# su - sysadmin -c "/usr/local/apache/virtualhosts/webtools/bin/apachetcl start"


0
 
LVL 2

Expert Comment

by:festive
ID: 2783895
the "su" method requires no setuid but does mean that root could be running things that could be altered by others (in this case the .profile of sysadmin)
0
 

Author Comment

by:hyphen
ID: 2803340
Thanks Festive,
Tried su - c "/usr/local/....blah, blah" in a symlink...it bombed out with an apache exit code 3

SETUID script is an effective way to run as "a specific user".

However, have found out there is a "virtualhosts/webtools/conf/http.conf" file with in Apache that you can use to set the user/group that this runs under. Then place appropriate symlink in the rc3.d directory (it kicks off as root and changes to "specified user/group"
regards hyphen
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now